Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Haochen Kotoi-Xie <hx@kxc.inc>
  • Loading branch information
haochenx committed Jun 9, 2023
1 parent 9324e66 commit 013da4a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/blackbox-tests/test-cases/melange/aliases.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ Default alias melange works
$ node _build/default/output2/main2.js
hello
Dune default alias works
$ cat > dune <<EOF
> (melange.emit
> (target output)
> (modules main))
> (melange.emit
> (target output2)
> (modules main2))
> EOF
$ cat > main2.ml <<EOF
> let () =
> print_endline "hello"
> EOF
$ dune clean
$ dune build
$ node _build/default/output/main.js
hello
$ node _build/default/output2/main2.js
hello
Users can override melange alias (even if useless)
$ cat > dune <<EOF
Expand All @@ -67,3 +90,17 @@ If user defines an alias, the default alias is not used for that stanza
Error: Alias "melange" specified on the command line is empty.
It is not defined in . or any of its descendants.
[1]
If user defines an alias, dune default alias no longer works
$ cat > dune <<EOF
> (melange.emit
> (target output)
> (modules main)
> (alias foo))
> EOF
$ dune clean
$ dune build
$ [[ -f _build/default/output/main.js ]]
[1]
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/melange/dune-rules.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Test dune rules
> print_endline "hello"
> EOF
Calling dune rules with the 'all' alias works fine
$ dune rules @all | grep In_build_dir
(In_build_dir _build/default/.output.mobjs/melange/melange__Main.cmj))))
Calling dune rules with the alias works fine
$ dune rules @melange | grep In_build_dir
Expand Down

0 comments on commit 013da4a

Please sign in to comment.