summaryrefslogtreecommitdiff
path: root/cli/tests/flags_tests.rs
blob: e19dad53490c3975626d63cb72ecef2cb9d95b25 (plain)
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
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

mod integration;

use test_util as util;

mod flags {
  use super::*;

  #[test]
  fn help_flag() {
    let status = util::deno_cmd()
      .current_dir(util::testdata_path())
      .arg("--help")
      .spawn()
      .unwrap()
      .wait()
      .unwrap();
    assert!(status.success());
  }

  #[test]
  fn version_short_flag() {
    let status = util::deno_cmd()
      .current_dir(util::testdata_path())
      .arg("-V")
      .spawn()
      .unwrap()
      .wait()
      .unwrap();
    assert!(status.success());
  }

  #[test]
  fn version_long_flag() {
    let status = util::deno_cmd()
      .current_dir(util::testdata_path())
      .arg("--version")
      .spawn()
      .unwrap()
      .wait()
      .unwrap();
    assert!(status.success());
  }

  itest!(types {
    args: "types",
    output: "types/types.out",
  });
}