mirror of
https://github.com/anoma/juvix.git
synced 2024-12-14 17:32:00 +03:00
46360a753c
* Closes #1913 * Closes #1976
300 lines
5.3 KiB
YAML
300 lines
5.3 KiB
YAML
working-directory: ./../../../../tests/
|
|
|
|
tests:
|
|
- name: open
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
contains: "Juvix REPL"
|
|
exit-status: 0
|
|
|
|
- name: infer-mutually-recursive-let-expression
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: ":type let even : _; odd : _; odd zero := false; odd (suc n) := not (even n); even zero := true; even (suc n) := not (odd n) in even 10"
|
|
stdout:
|
|
contains:
|
|
"Bool"
|
|
exit-status: 0
|
|
|
|
- name: eval-mutually-recursive-let-expression
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: "let even : Nat → Bool; odd : _; odd zero := false; odd (suc n) := not (even n); even zero := true; even (suc n) := not (odd n) in even 10"
|
|
stdout:
|
|
contains:
|
|
"true"
|
|
exit-status: 0
|
|
|
|
- name: quit
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
contains: "Juvix REPL"
|
|
stdin: ":quit"
|
|
exit-status: 0
|
|
|
|
- name: load-stdlib-by-default
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
matches:
|
|
regex: |
|
|
Juvix REPL .*
|
|
OK loaded: .*/stdlib/Stdlib/Prelude.juvix
|
|
exit-status: 0
|
|
|
|
- name: version-shows-same-juvix-version
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: ":version"
|
|
stdout:
|
|
matches:
|
|
regex: |
|
|
Juvix REPL version ([0-9]+\.[0-9]+\.[0-9]\-[a-z0-9]+): .*
|
|
OK loaded: .*
|
|
Stdlib.Prelude> \1
|
|
exit-status: 0
|
|
|
|
- name: check-type-null
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
contains: "{A : Type} → List A → Bool"
|
|
stdin: ":type null"
|
|
exit-status: 0
|
|
|
|
- name: check-type-suc
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
contains: "Nat → Nat"
|
|
stdin: ":type suc"
|
|
exit-status: 0
|
|
|
|
- name: check-type-suc-short
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdout:
|
|
contains: "Nat → Nat"
|
|
stdin: ":t suc"
|
|
exit-status: 0
|
|
|
|
- name: check-type-suc-short-stdlib
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
cd ./../juvix-stdlib && juvix repl Stdlib/Prelude.juvix
|
|
stdout:
|
|
contains: "Nat → Nat"
|
|
stdin: ":t suc"
|
|
exit-status: 0
|
|
|
|
- name: eval-and-operations
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: "true && false"
|
|
stdout:
|
|
matches: |
|
|
Juvix REPL .*
|
|
OK loaded: .*
|
|
Stdlib.Prelude> false
|
|
exit-status: 0
|
|
|
|
- name: eval-and-operations-with-spaces
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: " true && false"
|
|
stdout:
|
|
contains:
|
|
"false"
|
|
exit-status: 0
|
|
|
|
- name: eval-suc-true
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: "suc true"
|
|
stdout:
|
|
contains:
|
|
"Stdlib.Prelude> "
|
|
stderr:
|
|
contains: |
|
|
The expression true has type:
|
|
Bool
|
|
but is expected to have type:
|
|
Nat
|
|
exit-status: 0
|
|
|
|
- name: eval-let-expression
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: "let x : Nat; x := 2 + 1 in x"
|
|
stdout:
|
|
contains:
|
|
"3"
|
|
exit-status: 0
|
|
|
|
- name: load-builtin-bool
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
cd ./Internal/positive/ && juvix repl
|
|
stdin: ":load BuiltinBool.juvix"
|
|
stdout:
|
|
contains:
|
|
"BuiltinBool>"
|
|
exit-status: 0
|
|
|
|
- name: load-builtin-bool-with-spaces
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
cd ./Internal/positive/ && juvix repl
|
|
stdin: ":load BuiltinBool.juvix"
|
|
stdout:
|
|
contains:
|
|
BuiltinBool>
|
|
exit-status: 0
|
|
|
|
- name: load-builtin-bool-short-form
|
|
command:
|
|
shell:
|
|
- bash
|
|
script: |
|
|
cd ./Internal/positive/ && juvix repl
|
|
stdin: |
|
|
:l BuiltinBool.juvix
|
|
main
|
|
stdout:
|
|
contains: |
|
|
true
|
|
exit-status: 0
|
|
|
|
- name: repl-file
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
args:
|
|
- Internal/positive/BuiltinBool.juvix
|
|
stdin: main
|
|
stdout:
|
|
contains: |
|
|
true
|
|
exit-status: 0
|
|
|
|
- name: root
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: ":root"
|
|
stdout:
|
|
matches: |
|
|
Juvix REPL .*
|
|
OK loaded: .*
|
|
Stdlib.Prelude> .*/global-project/
|
|
exit-status: 0
|
|
|
|
- name: eval-adding-two-literal-nats
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
stdin: "1 + 2"
|
|
stdout:
|
|
contains: |
|
|
3
|
|
exit-status: 0
|
|
|
|
- name: repl-trace
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
args:
|
|
- positive/issue1731/builtinTrace.juvix
|
|
stdin: trace 2 >>> printNatLn 3
|
|
stdout:
|
|
contains: |
|
|
3
|
|
stderr: |
|
|
2
|
|
exit-status: 0
|
|
|
|
- name: repl-trace-file
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
args:
|
|
- positive/issue1731/builtinTrace.juvix
|
|
stdin: f 4 0
|
|
stdout:
|
|
contains: |
|
|
0
|
|
stderr: |
|
|
4
|
|
3
|
|
2
|
|
1
|
|
exit-status: 0
|
|
|
|
- name: repl-fail
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
args:
|
|
- positive/issue1731/builtinFail.juvix
|
|
stdin: main
|
|
stdout:
|
|
contains: |
|
|
Get
|
|
stderr:
|
|
contains: |
|
|
evaluation error: failure: Enough
|
|
exit-status: 0
|
|
|
|
- name: repl-transformations
|
|
command:
|
|
- juvix
|
|
- dev
|
|
- repl
|
|
- -t
|
|
- identity
|
|
stdin: "0"
|
|
stdout:
|
|
contains: |
|
|
zero
|
|
exit-status: 0
|