Merge pull request #693 from rgrinberg/false-target
Add test to show that jbuilder mishandles ${null}
This commit is contained in:
commit
17cceaa992
|
@ -1061,7 +1061,11 @@ module Infer = struct
|
||||||
|
|
||||||
module Unexp = Make(Unexpanded.Uast)(S_unexp)(Outcome_unexp)(struct
|
module Unexp = Make(Unexpanded.Uast)(S_unexp)(Outcome_unexp)(struct
|
||||||
open Outcome_unexp
|
open Outcome_unexp
|
||||||
let ( +@ ) acc fn = { acc with targets = fn :: acc.targets }
|
let ( +@ ) acc fn =
|
||||||
|
if SW.is_var fn ~name:"null" then
|
||||||
|
acc
|
||||||
|
else
|
||||||
|
{ acc with targets = fn :: acc.targets }
|
||||||
let ( +< ) acc _ = acc
|
let ( +< ) acc _ = acc
|
||||||
let ( +<! )= ( +< )
|
let ( +<! )= ( +< )
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -198,3 +198,8 @@ let to_string t =
|
||||||
|> String.concat ~sep:""
|
|> String.concat ~sep:""
|
||||||
|
|
||||||
let sexp_of_t t = Sexp.To_sexp.string (to_string t)
|
let sexp_of_t t = Sexp.To_sexp.string (to_string t)
|
||||||
|
|
||||||
|
let is_var t ~name =
|
||||||
|
match t.items with
|
||||||
|
| [Var (_, v)] -> v = name
|
||||||
|
| _ -> false
|
||||||
|
|
|
@ -43,6 +43,8 @@ val iter : t -> f:(Loc.t -> string -> unit) -> unit
|
||||||
(** [iter t ~f] iterates [f] over all variables of [t], the text
|
(** [iter t ~f] iterates [f] over all variables of [t], the text
|
||||||
portions being ignored. *)
|
portions being ignored. *)
|
||||||
|
|
||||||
|
val is_var : t -> name:string -> bool
|
||||||
|
|
||||||
module type EXPANSION = sig
|
module type EXPANSION = sig
|
||||||
type t
|
type t
|
||||||
(** The value to which variables are expanded. *)
|
(** The value to which variables are expanded. *)
|
||||||
|
|
|
@ -480,3 +480,12 @@
|
||||||
(run ${exe:cram.exe} run.t)
|
(run ${exe:cram.exe} run.t)
|
||||||
(diff? run.t run.t.corrected))))))
|
(diff? run.t run.t.corrected))))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps ((package jbuilder)
|
||||||
|
(files_recursively_in test-cases/null-dep)))
|
||||||
|
(action
|
||||||
|
(chdir test-cases/null-dep
|
||||||
|
(progn
|
||||||
|
(run ${exe:cram.exe} run.t)
|
||||||
|
(diff? run.t run.t.corrected))))))
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
(jbuild_version 1)
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(action (with-stdout-to ${null} (echo "hello world")))))
|
|
@ -0,0 +1 @@
|
||||||
|
$ jbuilder runtest --debug-dependency-path
|
Loading…
Reference in New Issue