Skip to content

Commit

Permalink
Merge pull request #8 from lukewilliamboswell/fix-7
Browse files Browse the repository at this point in the history
Fix for changes to String interpolation
  • Loading branch information
lukewilliamboswell authored Jan 13, 2024
2 parents f0402a8 + f78ecb6 commit 7fff485
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- run: ROC=./roc_nightly/roc ./ci/all_tests.sh
30 changes: 21 additions & 9 deletions ci/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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='./package'

# 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
$ROC docs $PACKAGE_DIR/main.roc
2 changes: 1 addition & 1 deletion examples/letters.roc
Original file line number Diff line number Diff line change
@@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion examples/numbers.roc
Original file line number Diff line number Diff line change
@@ -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 [
Expand Down
4 changes: 2 additions & 2 deletions package/String.roc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
## ```
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7fff485

Please sign in to comment.