aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-07-07 20:38:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-07-07 20:38:15 +0300
commit1c6fc35c120ee79ecbd6f0b2a8e9598ec0c68128 (patch)
treeb39fcfa512b1e5a767c6430d7d0be3d40d8e37d9 /tests
parent824fc5434f50c925ceb8da5f5586323babf98413 (diff)
Use [cmdline] type for canned commands in testscripts
Diffstat (limited to 'tests')
-rw-r--r--tests/git-common.testscript10
-rw-r--r--tests/git-pre-commit-common.testscript2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/git-common.testscript b/tests/git-common.testscript
index aa90f3d..7f4f585 100644
--- a/tests/git-common.testscript
+++ b/tests/git-common.testscript
@@ -4,14 +4,14 @@
# Set commonly-used variables and create an empty git repository that will be
# copied by subsequent tests and scope setup commands.
#
-g = git >! 2>&1
-gp = $g -C prj
-ga = $gp add
-gr = $gp rm
+g = [cmdline] git >! 2>&1
+gp = [cmdline] $g -C prj
+ga = [cmdline] $gp add
+gr = [cmdline] $gp rm
+$g init prj &prj/***
+$gp config user.name 'Test Script'
+$gp config user.email 'testscript@example.com'
-clone_prj = cp --no-cleanup -r ../prj ./ &prj/***
+clone_prj = [cmdline] cp --no-cleanup -r ../prj ./ &prj/***
diff --git a/tests/git-pre-commit-common.testscript b/tests/git-pre-commit-common.testscript
index ae8b9d4..6296839 100644
--- a/tests/git-pre-commit-common.testscript
+++ b/tests/git-pre-commit-common.testscript
@@ -4,7 +4,7 @@
# Set commonly-used variables and configure git to call the hook being tested.
# Assume that git-common.testscript is already included.
#
-gc = $gp commit -a --allow-empty-message -m ''
+gc = [cmdline] $gp commit -a --allow-empty-message -m ''
hooks_dir=$~/hooks
+mkdir $hooks_dir