From 734d46fbce93bc176e0d11138a20afce7c8e572c Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 13 Jan 2024 10:38:13 +1100 Subject: [PATCH 1/5] fix $ in strings --- package/String.roc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/String.roc b/package/String.roc index 1e23b59..bd55533 100644 --- a/package/String.roc +++ b/package/String.roc @@ -163,7 +163,7 @@ anyCodeunit : Parser Utf8 U8 anyCodeunit = codeunitSatisfies (\_ -> Bool.true) expect parseStr anyCodeunit "a" == Ok 'a' -expect parseStr anyCodeunit "$" == Ok '$' +expect parseStr anyCodeunit "\$" == Ok 36 ## Matches any [Utf8] and consumes all the input without fail. ## ``` @@ -321,7 +321,7 @@ atSign = const AtSign |> skip (codeunit '@') expect parseStr atSign "@" == Ok AtSign expect parseStrPartial atSign "@" |> Result.map .val == Ok AtSign -expect parseStrPartial atSign "$" |> Result.isErr +expect parseStrPartial atSign "\$" |> Result.isErr Requirement : [ Green Nat, Red Nat, Blue Nat ] RequirementSet : List Requirement From 206c29979dfca7df39d159b3edc07a464fbadc84 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 13 Jan 2024 10:39:18 +1100 Subject: [PATCH 2/5] update test script --- .github/workflows/tests.yaml | 7 +------ ci/all_tests.sh | 30 +++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1d94edc..ddf8b84 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,10 +31,5 @@ jobs: - run: ./roc_nightly/roc version - - run: sudo apt install -y expect - # expect for testing - - - run: expect -v - # Run all tests - - run: ./ci/all_tests.sh \ No newline at end of file + - run: ROC=./roc_nightly/roc ./ci/all_tests.sh \ No newline at end of file diff --git a/ci/all_tests.sh b/ci/all_tests.sh index 6504576..bd7b814 100755 --- a/ci/all_tests.sh +++ b/ci/all_tests.sh @@ -3,26 +3,38 @@ # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ set -euxo pipefail -roc='./roc_nightly/roc' +# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +set -euxo pipefail + +if [ -z "${ROC}" ]; then + echo "ERROR: The ROC environment variable is not set. + Set it to something like: + /home/username/Downloads/roc_nightly-linux_x86_64-2023-10-30-cb00cfb/roc + or + /home/username/gitrepos/roc/target/build/release/roc" >&2 + + exit 1 +fi -examples_dir='./examples/' +EXAMPLES_DIR='./examples/' +PACKAGE_DIR='./platform/' # roc check -for roc_file in $examples_dir*.roc; do - $roc check $roc_file +for ROC_FILE in $EXAMPLES_DIR*.roc; do + $ROC check $ROC_FILE done # roc build -for roc_file in $examples_dir*.roc; do - $roc build $roc_file --linker=legacy +for ROC_FILE in $EXAMPLES_DIR*.roc; do + $ROC build $ROC_FILE --linker=legacy done # check output -# for roc_file in $examples_dir*.roc; do -# roc_file_only="$(basename "$roc_file")" +# for ROC_FILE in $EXAMPLES_DIR*.roc; do +# ROC_FILE_only="$(basename "$ROC_FILE")" # no_ext_name=${roc_file_only%.*} # expect ci/expect_scripts/$no_ext_name.exp # done # test building docs website -$roc docs package/main.roc \ No newline at end of file +$roc docs $PACKAGE_DIR/main.roc \ No newline at end of file From 93b2bcd89a55e251df320d9f24ded2e06f5ddfea Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 13 Jan 2024 10:42:32 +1100 Subject: [PATCH 3/5] fix test script, upgrade to basic-cli 0.7.1 --- ci/all_tests.sh | 2 +- examples/letters.roc | 2 +- examples/numbers.roc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/all_tests.sh b/ci/all_tests.sh index bd7b814..ec62d27 100755 --- a/ci/all_tests.sh +++ b/ci/all_tests.sh @@ -37,4 +37,4 @@ done # done # test building docs website -$roc docs $PACKAGE_DIR/main.roc \ No newline at end of file +$ROC docs $PACKAGE_DIR/main.roc \ No newline at end of file diff --git a/examples/letters.roc b/examples/letters.roc index 007d344..51b16ae 100644 --- a/examples/letters.roc +++ b/examples/letters.roc @@ -1,6 +1,6 @@ app "example" packages { - cli: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br", + cli: "https://github.com/roc-lang/basic-cli/releases/download/0.7.1/Icc3xJoIixF3hCcfXrDwLCu4wQHtNdPyoJkEbkgIElA.tar.br", parser: "../package/main.roc", } imports [ diff --git a/examples/numbers.roc b/examples/numbers.roc index 5868de3..bf75a51 100644 --- a/examples/numbers.roc +++ b/examples/numbers.roc @@ -1,6 +1,6 @@ app "example" packages { - cli: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br", + cli: "https://github.com/roc-lang/basic-cli/releases/download/0.7.1/Icc3xJoIixF3hCcfXrDwLCu4wQHtNdPyoJkEbkgIElA.tar.br", parser: "../package/main.roc", } imports [ From fa9a8f8e8f2e7754f2f2d67d7f75ffad0d683b54 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 13 Jan 2024 10:44:05 +1100 Subject: [PATCH 4/5] fix test script --- ci/all_tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/all_tests.sh b/ci/all_tests.sh index ec62d27..13af1f9 100755 --- a/ci/all_tests.sh +++ b/ci/all_tests.sh @@ -16,16 +16,16 @@ if [ -z "${ROC}" ]; then exit 1 fi -EXAMPLES_DIR='./examples/' -PACKAGE_DIR='./platform/' +EXAMPLES_DIR='./examples' +PACKAGE_DIR='./platform' # roc check -for ROC_FILE in $EXAMPLES_DIR*.roc; do +for ROC_FILE in $EXAMPLES_DIR/*.roc; do $ROC check $ROC_FILE done # roc build -for ROC_FILE in $EXAMPLES_DIR*.roc; do +for ROC_FILE in $EXAMPLES_DIR/*.roc; do $ROC build $ROC_FILE --linker=legacy done From f78ecb696279171e2f0e4c840a14d5087ca9d1dd Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sat, 13 Jan 2024 10:56:12 +1100 Subject: [PATCH 5/5] fix CI --- ci/all_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/all_tests.sh b/ci/all_tests.sh index 13af1f9..0755d76 100755 --- a/ci/all_tests.sh +++ b/ci/all_tests.sh @@ -17,7 +17,7 @@ if [ -z "${ROC}" ]; then fi EXAMPLES_DIR='./examples' -PACKAGE_DIR='./platform' +PACKAGE_DIR='./package' # roc check for ROC_FILE in $EXAMPLES_DIR/*.roc; do