summaryrefslogtreecommitdiff
path: root/std/flags/stop_early_test.ts
blob: 219ef8042fe06fea0e4ac4402ae5ac0915d3d9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../testing/asserts.ts";
import { parse } from "./mod.ts";

// stops parsing on the first non-option when stopEarly is set
Deno.test("stopParsing", function (): void {
  const argv = parse(["--aaa", "bbb", "ccc", "--ddd"], {
    stopEarly: true,
  });

  assertEquals(argv, {
    aaa: "bbb",
    _: ["ccc", "--ddd"],
  });
});