Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JuvixTree smoke tests #2598

Merged
merged 1 commit into from
Jan 31, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/Juvix/Compiler/Asm/Pretty/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ instance (PrettyCode a) => PrettyCode [a] where
return $ encloseSep "[" "]" ", " cs

instance PrettyCode FunctionInfo where
ppCode = Tree.ppFunInfo ppCode
ppCode = Tree.ppFunInfo ppCodeCode

instance PrettyCode ConstructorInfo where
ppCode = Tree.ppCode

instance PrettyCode InfoTable where
ppCode = Tree.ppInfoTable ppCode
ppCode = Tree.ppInfoTable ppCodeCode

{--------------------------------------------------------------------------------}
{- helper functions -}
Expand Down
70 changes: 70 additions & 0 deletions tests/smoke/Commands/dev/tree.smoke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
working-directory: ./../../../../tests

tests:
- name: tree-eval
command:
- juvix
- dev
- tree
- eval
args:
- Tree/positive/test001.jvt
stdout: |
11
exit-status: 0

- name: tree-read
command:
- juvix
- dev
- tree
- read
args:
- Tree/positive/test001.jvt
stdout:
contains: |
function main() : * {
mod(sub(25, mul(7, div(9, sub(15, add(mul(2, 3), 5))))), 12)
}
exit-status: 0

- name: tree-from-asm
command:
- juvix
- dev
- tree
- from-asm
args:
- Asm/positive/test001.jva
stdout:
contains: |
function main() : * {
mod(sub(25, mul(7, div(9, sub(15, add(mul(2, 3), 5))))), 12)
}
exit-status: 0

- name: tree-compile
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
juvix dev tree compile -o $temp/test001 Tree/positive/test001.jvt
$temp/test001
stdout: |
11
exit-status: 0

- name: tree-compile-asm
command:
shell:
- bash
script: |
temp=$(mktemp -d)
trap 'rm -rf -- "$temp"' EXIT
juvix dev tree compile -t asm -o $temp/test001.jva Tree/positive/test001.jvt
juvix dev asm run $temp/test001.jva
stdout: |
11
exit-status: 0
Loading