Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-idris2-and-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ jobs:
ubuntu-self-host-racket:
needs: ubuntu-bootstrap-racket
runs-on: ubuntu-latest
if: false
timeout-minutes: 60
env:
IDRIS2_CG: racket
steps:
Expand Down
6 changes: 3 additions & 3 deletions libs/test/Test/Golden.idr
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ record TestPool where
codegen : Codegen
testCases : List String

findTests : (String -> Bool) -> Codegen -> String -> String -> IO (List String)
findTests pred codegen poolName dirName = do
findTests : (String -> Bool) -> String -> IO (List String)
findTests pred dirName = do
Right names <- listDir dirName
| Left e => die $ "failed to list " ++ dirName ++ ": " ++ show e
let names = [n | n <- names, pred n]
Expand Down Expand Up @@ -462,7 +462,7 @@ testsInDir :
{default Nothing codegen : Codegen} ->
Lazy (IO TestPool)
testsInDir dirName poolName = do
testNames <- findTests pred codegen poolName dirName
testNames <- findTests pred dirName
when (length testNames == 0) $ die $ "no tests found in " ++ dirName
pure $ MkTestPool poolName requirements codegen testNames

Expand Down
2 changes: 1 addition & 1 deletion tests/chez/barrier001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg chez Main.idr
run Main.idr
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/idris2/basic/case001/run → tests/chez/case001/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../../testutils.sh
. ../../testutils.sh

idris2 --codegen chez InlineCase.idr -o inline-case
idris2 InlineCase.idr -o inline-case
grep "define InlineCase-product" build/exec/inline-case_app/inline-case.ss
6 changes: 3 additions & 3 deletions tests/chez/chez031/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. ../../testutils.sh

run --cg chez Specifiers.idr
idris2 --cg chez Specifiers.idr -o build/foo
idris2 --cg chez < input
run Specifiers.idr
idris2 Specifiers.idr -o build/foo
idris2 < input
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/chez/forkjoin001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg chez Main.idr
run Main.idr
16 changes: 8 additions & 8 deletions tests/chez/futures001/run
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
. ../../testutils.sh

idris2 --cg chez Futures.idr -p contrib --exec constant
idris2 --cg chez Futures.idr -p contrib --exec simpleIO
idris2 --cg chez Futures.idr -p contrib --exec erasureAndNonbindTest
idris2 --cg chez Futures.idr -p contrib --exec map
idris2 Futures.idr -p contrib --exec constant
idris2 Futures.idr -p contrib --exec simpleIO
idris2 Futures.idr -p contrib --exec erasureAndNonbindTest
idris2 Futures.idr -p contrib --exec map

echo "----"

idris2 --cg chez --directive lazy=weakMemo Futures.idr -p contrib --exec constant
idris2 --cg chez --directive lazy=weakMemo Futures.idr -p contrib --exec simpleIO
idris2 --cg chez --directive lazy=weakMemo Futures.idr -p contrib --exec erasureAndNonbindTest
idris2 --cg chez --directive lazy=weakMemo Futures.idr -p contrib --exec map
idris2 --directive lazy=weakMemo Futures.idr -p contrib --exec constant
idris2 --directive lazy=weakMemo Futures.idr -p contrib --exec simpleIO
idris2 --directive lazy=weakMemo Futures.idr -p contrib --exec erasureAndNonbindTest
idris2 --directive lazy=weakMemo Futures.idr -p contrib --exec map

rm -r build
4 changes: 2 additions & 2 deletions tests/chez/futures002/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
. ../../testutils.sh

idris2 --cg chez Futures.idr -p contrib --exec main
idris2 Futures.idr -p contrib --exec main
echo "----"
idris2 --cg chez --directive lazy=weakMemo Futures.idr -p contrib --exec main
idris2 --directive lazy=weakMemo Futures.idr -p contrib --exec main

rm -r build
2 changes: 1 addition & 1 deletion tests/chez/semaphores001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg chez Main.idr
run Main.idr
2 changes: 1 addition & 1 deletion tests/chez/semaphores002/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg chez Main.idr
run Main.idr
25 changes: 25 additions & 0 deletions tests/codegen/fix3515/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
1
0
------
Main> Main.toNat
Arguments [{arg:1}, {arg:2}]
Compile time tree: case {arg:1} of
Z => case {arg:2} of
MkUnit => 1
_ => 0
_ => 0
Detaggable arg types: [1]
Compiled: \ {arg:1}, {arg:2} => case {arg:1} of
{ 0 => 1
; _ => 0
}
Refers to: Prelude.Types.Z, Prelude.Types.S
Flags: allguarded, covering
Size change:
Prelude.Types.S:
l 0
r +--
0 | =
Prelude.Types.Z:
l
r +
Main>
Bye for now!
1 change: 1 addition & 0 deletions tests/codegen/fix3515/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:di Main.toNat
6 changes: 3 additions & 3 deletions tests/codegen/fix3515/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. ../../testutils.sh

idris2 -o main Main.idr

./build/exec/main
run Main.idr
echo "------"
idris2 Main.idr < input
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/node/args/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
. ../../testutils.sh

idris2 --cg node -o node_args TestArgs.idr > /dev/null
idris2 -o node_args TestArgs.idr > /dev/null
node ./build/exec/node_args a b
node ./build/exec/node_args c
2 changes: 1 addition & 1 deletion tests/node/bitops/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node BitOps.idr
run BitOps.idr
2 changes: 1 addition & 1 deletion tests/node/casts/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Casts.idr
run Casts.idr
2 changes: 1 addition & 1 deletion tests/node/doubles/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../testutils.sh

idris2 --cg node -o node_doubles.js Doubles.idr > /dev/null
idris2 -o node_doubles.js Doubles.idr > /dev/null
node build/exec/node_doubles.js
2 changes: 1 addition & 1 deletion tests/node/executable/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ../../testutils.sh

idris2 --cg node -o node_executable TestExecutable.idr > /dev/null
idris2 -o node_executable TestExecutable.idr > /dev/null

# node still executes it:
node ./build/exec/node_executable
Expand Down
2 changes: 1 addition & 1 deletion tests/node/fastConcat/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node FastConcat.idr
run FastConcat.idr
2 changes: 1 addition & 1 deletion tests/node/ffi001/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
. ../../testutils.sh
run --cg node Foreign.idr
run Foreign.idr
2 changes: 1 addition & 1 deletion tests/node/fix1839/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../testutils.sh

run --cg node OS.idr
run OS.idr
idris2 --cg javascript -o os.js OS.idr
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/codegen/fix3375/run → tests/node/fix3375/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
. ../../testutils.sh

idris2 --quiet --codegen node -o prog.js Prog.idr
idris2 --quiet -o prog.js Prog.idr

grep "const \$[a-z0-9]\+ = undefined;" build/exec/prog.js
grep "const \$[a-z0-9]\+ = \$[a-z0-9]\+;" build/exec/prog.js
2 changes: 1 addition & 1 deletion tests/node/idiom001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Main.idr
run Main.idr
2 changes: 1 addition & 1 deletion tests/node/integer_array/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node array.idr
run array.idr
2 changes: 1 addition & 1 deletion tests/node/integers/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../testutils.sh

idris2 --cg node -o node_integers.js TestIntegers.idr > /dev/null
idris2 -o node_integers.js TestIntegers.idr > /dev/null
node build/exec/node_integers.js
2 changes: 1 addition & 1 deletion tests/node/memo/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Memo.idr
run Memo.idr
2 changes: 1 addition & 1 deletion tests/node/newints/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node IntOps.idr
run IntOps.idr
2 changes: 1 addition & 1 deletion tests/node/node001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Total.idr
run Total.idr
2 changes: 1 addition & 1 deletion tests/node/node002/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

idris2 --cg node Pythag.idr < input
idris2 Pythag.idr < input
2 changes: 1 addition & 1 deletion tests/node/node003/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node IORef.idr
run IORef.idr
2 changes: 1 addition & 1 deletion tests/node/node004/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

rm test.buf

run --cg node Buffer.idr
run Buffer.idr
2 changes: 1 addition & 1 deletion tests/node/node005/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

idris2 --cg node Filter.idr < input
idris2 Filter.idr < input
4 changes: 2 additions & 2 deletions tests/node/node006/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../testutils.sh

idris2 --cg node TypeCase.idr < input
check --cg node TypeCase2.idr
idris2 TypeCase.idr < input
check TypeCase2.idr
2 changes: 1 addition & 1 deletion tests/node/node007/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node TypeCase.idr
run TypeCase.idr
2 changes: 1 addition & 1 deletion tests/node/node008/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Nat.idr
run Nat.idr
2 changes: 1 addition & 1 deletion tests/node/node009/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node uni.idr
run uni.idr
2 changes: 1 addition & 1 deletion tests/node/node011/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

idris2 --cg node bangs.idr < input
idris2 bangs.idr < input
2 changes: 1 addition & 1 deletion tests/node/node012/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node array.idr
run array.idr
2 changes: 1 addition & 1 deletion tests/node/node015/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Numbers.idr
run Numbers.idr
2 changes: 1 addition & 1 deletion tests/node/node017/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

rm -rf testdir

run --cg node dir.idr | filter_test_dir
run dir.idr | filter_test_dir
cat testdir/test.txt
2 changes: 1 addition & 1 deletion tests/node/node018/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

rm testout.txt

run --cg node File.idr
run File.idr
2 changes: 1 addition & 1 deletion tests/node/node019/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

idris2 --cg node partial.idr < input
idris2 partial.idr < input
2 changes: 1 addition & 1 deletion tests/node/node020/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

POPEN_CMD="$idris2 --version" run --cg node Popen.idr
POPEN_CMD="$idris2 --version" run Popen.idr
2 changes: 1 addition & 1 deletion tests/node/node021/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

idris2 --cg node Bits.idr < input
idris2 Bits.idr < input
2 changes: 1 addition & 1 deletion tests/node/node022/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node BitCasts.idr
run BitCasts.idr
2 changes: 1 addition & 1 deletion tests/node/node023/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Casts.idr
run Casts.idr
2 changes: 1 addition & 1 deletion tests/node/node024/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node BitOps.idr
run BitOps.idr
2 changes: 1 addition & 1 deletion tests/node/node025/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Fix1037.idr
run Fix1037.idr
2 changes: 1 addition & 1 deletion tests/node/node026/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run -p contrib --cg node Fix1795.idr
run -p contrib Fix1795.idr
2 changes: 1 addition & 1 deletion tests/node/node027/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node PID.idr
run PID.idr
4 changes: 2 additions & 2 deletions tests/node/node028/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ echo '--------------'

echo '# Running an example without any top-level constants...'
echo '# We expect no usages of `__lazy` to be present, maybe only a definition.'
run --cg node -o hw.js HelloWorld.idr
run -o hw.js HelloWorld.idr
grep '__lazy' build/exec/hw.js

echo '--------------'

echo '# Running an example with some top-level constant...'
echo '# We expect `__lazy` to be used on the RHS for the top-level constant called `topLevelConst`.'
run --cg node -o lsth.js LazyIsStillThere.idr
run -o lsth.js LazyIsStillThere.idr
grep '__lazy' build/exec/lsth.js
4 changes: 2 additions & 2 deletions tests/node/nomangle001/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
. ../../testutils.sh

idris2 nomangle.idr -o test1 --cg node
idris2 nomangle.idr -o test2 --cg node --directive minimal
idris2 nomangle.idr -o test1
idris2 nomangle.idr -o test2 --directive minimal

cat build/exec/test1 | grep -e foo -e baz -e another_name
cat build/exec/test2 | grep -e foo -e baz -e another_name
4 changes: 2 additions & 2 deletions tests/node/nomangle002/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
. ../../testutils.sh

idris2 nomangle1.idr -o test --cg node
idris2 nomangle2.idr -o test --cg node
idris2 nomangle1.idr -o test
idris2 nomangle2.idr -o test
2 changes: 1 addition & 1 deletion tests/node/perf001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Span.idr
run Span.idr
2 changes: 1 addition & 1 deletion tests/node/reg001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node numbers.idr
run numbers.idr
2 changes: 1 addition & 1 deletion tests/node/reg002/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node Issue1843.idr
run Issue1843.idr
2 changes: 1 addition & 1 deletion tests/node/stringcast/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node StringCast.idr
run StringCast.idr
2 changes: 1 addition & 1 deletion tests/node/syntax001/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
. ../../testutils.sh

run --cg node caseBlock.idr
run caseBlock.idr
Loading