update tests
diff --git a/examples/BUILD b/examples/BUILD index 40e5e7c..fd6e4c3 100644 --- a/examples/BUILD +++ b/examples/BUILD
@@ -28,7 +28,6 @@ ], deps = [ "@bazel_tools//tools/bash/runfiles", - "@cgrindel_bazel_starlib//shlib/lib:assertions", ], )
diff --git a/examples/modify_example_test_runner.sh b/examples/modify_example_test_runner.sh index 6042974..568a1c7 100755 --- a/examples/modify_example_test_runner.sh +++ b/examples/modify_example_test_runner.sh
@@ -11,10 +11,10 @@ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -assertions_sh_location=cgrindel_bazel_starlib/shlib/lib/assertions.sh -assertions_sh="$(rlocation "${assertions_sh_location}")" || \ - (echo >&2 "Failed to locate ${assertions_sh_location}" && exit 1) -source "${assertions_sh}" +fail() { + echo >&2 "$@" + exit 1 +} create_scratch_dir_sh_location=rules_bazel_integration_test/tools/create_scratch_dir.sh create_scratch_dir_sh="$(rlocation "${create_scratch_dir_sh_location}")" || \
diff --git a/tests/tools_tests/BUILD b/tests/tools_tests/BUILD index 7978040..c45e768 100644 --- a/tests/tools_tests/BUILD +++ b/tests/tools_tests/BUILD
@@ -20,6 +20,5 @@ }), deps = [ "@bazel_tools//tools/bash/runfiles", - "@cgrindel_bazel_starlib//shlib/lib:assertions", ], )
diff --git a/tests/tools_tests/generate_assets_declaration_test.sh b/tests/tools_tests/generate_assets_declaration_test.sh index 76549b4..ab19ac6 100755 --- a/tests/tools_tests/generate_assets_declaration_test.sh +++ b/tests/tools_tests/generate_assets_declaration_test.sh
@@ -14,11 +14,6 @@ # MARK - Locate Deps -assertions_sh_location=cgrindel_bazel_starlib/shlib/lib/assertions.sh -assertions_sh="$(rlocation "${assertions_sh_location}")" || \ - (echo >&2 "Failed to locate ${assertions_sh_location}" && exit 1) -source "${assertions_sh}" - generate_assets_declaration_sh_location=buildifier_prebuilt/tools/generate_assets_declaration.sh generate_assets_declaration_sh="$(rlocation "${generate_assets_declaration_sh_location}")" || \ (echo >&2 "Failed to locate ${generate_assets_declaration_sh_location}" && exit 1) @@ -37,6 +32,17 @@ # MARK - Test with Release Tag actual="$( "${generate_assets_declaration_sh}" "4.2.3" )" + +assert_match() { + local pattern="$1" + local actual="$2" + if ! echo "${actual}" | grep -qE "${pattern}"; then + echo >&2 "Expected to match '${pattern}' in output:" + echo >&2 "${actual}" + exit 1 + fi +} + assert_match "version.*4.2.3" "${actual}" assert_match \ "buildifier_darwin_amd64.*954ec397089344b1564e45dc095e9331e121eb0f20e72032fcc8e94de78e5663" \