Skip to content

Commit

Permalink
smoke tests & bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Jan 26, 2024
1 parent 4fe9538 commit 0f9b3d9
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
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

0 comments on commit 0f9b3d9

Please sign in to comment.