aboutsummaryrefslogtreecommitdiffstats
path: root/test/tests
diff options
context:
space:
mode:
authorMichele Locati <michele@locati.it>2018-03-13 17:15:03 +0100
committerMichele Locati <michele@locati.it>2018-03-13 17:15:03 +0100
commitc9b06645de2e0ceff23272de930418fb66b870e0 (patch)
treeb9581d210e52c2ce24ab48ced2ea21f11aa9425a /test/tests
parent913a57e4bec599ca8a06f8b4aef6e9594842efe6 (diff)
downloadincremental-git-filter-branch-c9b06645de2e0ceff23272de930418fb66b870e0.tar.gz
incremental-git-filter-branch-c9b06645de2e0ceff23272de930418fb66b870e0.tar.bz2
incremental-git-filter-branch-c9b06645de2e0ceff23272de930418fb66b870e0.zip
Start adding tests
Diffstat (limited to 'test/tests')
-rw-r--r--test/tests/empty-filter-options.fail5
-rw-r--r--test/tests/filter-directory-visited-tags.success25
-rw-r--r--test/tests/get-help.success7
-rw-r--r--test/tests/invalid-filter-options.fail5
-rw-r--r--test/tests/misplaced-help.fail5
5 files changed, 47 insertions, 0 deletions
diff --git a/test/tests/empty-filter-options.fail b/test/tests/empty-filter-options.fail
new file mode 100644
index 0000000..59d086d
--- /dev/null
+++ b/test/tests/empty-filter-options.fail
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap.sh"
+
+"${BIN_MAIN}" -- "${DIR_SOURCE}" '' "${DIR_DESTINATION}"
diff --git a/test/tests/filter-directory-visited-tags.success b/test/tests/filter-directory-visited-tags.success
new file mode 100644
index 0000000..527ee5a
--- /dev/null
+++ b/test/tests/filter-directory-visited-tags.success
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap.sh"
+
+initializeRepositories
+
+"${BIN_MAIN}" "${DIR_SOURCE}" '--prune-empty --subdirectory-filter subdir' "${DIR_DESTINATION}"
+
+echo 'Fetching tags'
+tags=$(getTagList "${DIR_DESTINATION}")
+if itemInList 'tag-01' "${tags}"
+then
+ printf '%s should not be in tag list:\n%s\n' 'tag-01' "${tags}" >&2
+ exit 1
+fi
+if itemNotInList 'tag-02' "${tags}"
+then
+ printf '%s should be in tag list:\n%s\n' 'tag-02' "${tags}" >&2
+ exit 1
+fi
+if itemInList 'tag-03' "${tags}"
+then
+ printf '%s should not be in tag list:\n%s\n' 'tag-02' "${tags}" >&2
+ exit 1
+fi
diff --git a/test/tests/get-help.success b/test/tests/get-help.success
new file mode 100644
index 0000000..58036a8
--- /dev/null
+++ b/test/tests/get-help.success
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap.sh"
+
+"${BIN_MAIN}" -h
+"${BIN_MAIN}" --help
+"${BIN_MAIN}" --help this is an invalid number of arguments
diff --git a/test/tests/invalid-filter-options.fail b/test/tests/invalid-filter-options.fail
new file mode 100644
index 0000000..5ee6680
--- /dev/null
+++ b/test/tests/invalid-filter-options.fail
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap.sh"
+
+"${BIN_MAIN}" -- "${DIR_SOURCE}" b "${DIR_DESTINATION}"
diff --git a/test/tests/misplaced-help.fail b/test/tests/misplaced-help.fail
new file mode 100644
index 0000000..a5c2e8f
--- /dev/null
+++ b/test/tests/misplaced-help.fail
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. "$(cd -- "$(dirname -- "$0")" && pwd -P)/../bootstrap.sh"
+
+"${BIN_MAIN}" -- --help

© 2014-2024 Faster IT GmbH | imprint | privacy policy