File: allow_missing.rs

package info (click to toggle)
rust-just 1.43.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,068 kB
  • sloc: sh: 300; makefile: 6
file content (50 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use super::*;

#[test]
fn allow_missing_recipes_in_run_invocation() {
  Test::new()
    .arg("foo")
    .stderr("error: Justfile does not contain recipe `foo`\n")
    .status(EXIT_FAILURE)
    .run();

  Test::new().args(["--allow-missing", "foo"]).run();
}

#[test]
fn allow_missing_modules_in_run_invocation() {
  Test::new()
    .arg("foo::bar")
    .stderr("error: Justfile does not contain submodule `foo`\n")
    .status(EXIT_FAILURE)
    .run();

  Test::new().args(["--allow-missing", "foo::bar"]).run();
}

#[test]
fn allow_missing_does_not_apply_to_compilation_errors() {
  Test::new()
    .justfile("bar: foo")
    .args(["--allow-missing", "foo"])
    .stderr(
      "
        error: Recipe `bar` has unknown dependency `foo`
         ——▶ justfile:1:6
        1 │ bar: foo
          │      ^^^
      ",
    )
    .status(EXIT_FAILURE)
    .run();
}

#[test]
fn allow_missing_does_not_apply_to_other_subcommands() {
  Test::new()
    .args(["--allow-missing", "--show", "foo"])
    .stderr("error: Justfile does not contain recipe `foo`\n")
    .status(EXIT_FAILURE)
    .run();
}