From 796ce4ec010b0217ecf74dc57ad63d4c4df1e399 Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Wed, 9 Aug 2023 14:38:32 -0700 Subject: [PATCH] Trying out an automated check to prevent future bash test bugs on Mac --- integration-tests/bats/bats.bats | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 integration-tests/bats/bats.bats diff --git a/integration-tests/bats/bats.bats b/integration-tests/bats/bats.bats new file mode 100644 index 0000000000..ef477e2feb --- /dev/null +++ b/integration-tests/bats/bats.bats @@ -0,0 +1,14 @@ +#!/usr/bin/env bats + + +@test "bats: all assertions work on Mac" { + run pwd + echo "PWD: $output" + + run grep -E ' *\]\][[:space:]]*$' -n *.bats + # grep returns 0 if matches are found, 1 if matches are NOT found, and 2 if no input files were found + echo -e "Incorrect bash test constructs: \n$output" + [ "$status" -eq 1 ] + [[ "$output" =~ "No tables to export." ]] + [[ "$output" =~ "another" ]] +} \ No newline at end of file