Skip to content

Commit

Permalink
Apply a suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
  • Loading branch information
moyodiallo committed Sep 20, 2024
1 parent c8b2120 commit 00fc5cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dune_rules/enabled_if.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let common_vars ~since =
match var with
| "context_name" -> var, (2, 7)
| "arch_sixtyfour" -> var, (3, 11)
| "env" -> var, (1, 14)
| "env" -> var, (3, 17)
| _ -> var, since)
common_vars_list)
;;
Expand Down
15 changes: 15 additions & 0 deletions test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ Test enabled_if with 'env' variable.
> (modes exe))
> EOF

$ MYVAR=disabled dune exec -- dune_test
File "dune", line 10, characters 24-45:
10 | (enabled_if (= enabled %{env:MYVAR=disabled}))
^^^^^^^^^^^^^^^^^^^^^
Error: %{env:..} is only available since version 3.17 of the dune language.
Please update your dune-project file to have (lang dune 3.17).
[1]

$ cat > dune-project <<EOF
> (lang dune 3.17)
> (name dune-test)
> (package
> (name dune-test))
> EOF

$ cat > main.ml <<EOF
> let () = print_string "Hello world"
> EOF
Expand Down

0 comments on commit 00fc5cc

Please sign in to comment.