From aefd4df2f51540034d17b1feee3ae73a59eb3e6e Mon Sep 17 00:00:00 2001 From: Chris Stone Date: Mon, 21 Jul 2025 05:19:33 -0600 Subject: [PATCH] Add basic version test --- README.md | 9 +++++++++ tests/version.sh | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100755 tests/version.sh diff --git a/README.md b/README.md index af2e30a..fb877b7 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,15 @@ If submiting a new pull request addressing an already open issue with gitflow-av For any new PRs releated to gitflow-cjs you can use on of the keywords from [Linking a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to automatically close the releated issue. +## Running tests + +To run the basic test suite execute: + +```shell +bash tests/version.sh +``` + + ## License terms git-flow is published under the FreeBSD License, see the diff --git a/tests/version.sh b/tests/version.sh new file mode 100755 index 0000000..e92245e --- /dev/null +++ b/tests/version.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e +expected=$(grep -m1 '^GITFLOW_VERSION=' git-flow-version | cut -d'=' -f2) +output=$(bash -c 'source ./git-flow-version; cmd_default') +if [ "$output" = "$expected (CJS Edition)" ]; then + echo "Version test passed" + exit 0 +else + echo "Expected '$expected (CJS Edition)' but got '$output'" >&2 + exit 1 +fi