Skip to content

Commit

Permalink
Apply a suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: Alpha DIALLO <[email protected]>
  • Loading branch information
moyodiallo committed Sep 23, 2024
1 parent 51ba856 commit fd800a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
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, 15)
| _ -> var, since)
common_vars_list)
;;
Expand Down
17 changes: 16 additions & 1 deletion test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Test enabled_if with 'env' variable.

$ cat > dune-project <<EOF
> (lang dune 3.16)
> (lang dune 3.14)
> (name dune-test)
> (package
> (name dune-test))
Expand All @@ -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.15 of the dune language.
Please update your dune-project file to have (lang dune 3.15).
[1]

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

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

0 comments on commit fd800a0

Please sign in to comment.