Skip to content

Commit

Permalink
Remove redundant compatibility test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ericcornelissen committed Oct 23, 2023
1 parent 17a5cf5 commit 3471de0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 54 deletions.
3 changes: 1 addition & 2 deletions test/compat/_.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
*/

import * as arbitrary from "../_arbitraries.js";
import * as constants from "../_constants.js";

export { arbitrary, constants };
export { arbitrary };
53 changes: 1 addition & 52 deletions test/compat/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,11 @@

import { testProp } from "@fast-check/ava";
import * as fc from "fast-check";
import test from "ava";

import { arbitrary, constants } from "./_.js";
import { arbitrary } from "./_.js";

import { Shescape } from "../../index.js";

test.before((t) => {
t.context.quoteShell = constants.isWindows
? constants.binCmd
: constants.binBash;
});

test("has a working `escape` function", (t) => {
const shescape = new Shescape({ shell: false });

t.true(typeof shescape.escape === "function");

const input = "Hello world!";
const result = shescape.escape(input);
t.is(typeof result, "string");
});

test("has a working `escapeAll` function", (t) => {
const shescape = new Shescape({ shell: false });

t.true(typeof shescape.escapeAll === "function");

const inputs = ["foo", "bar"];
const result = shescape.escapeAll(inputs);
for (const output of result) {
t.is(typeof output, "string");
}
});

test("has a working `quote` function", (t) => {
const shescape = new Shescape({ shell: t.context.quoteShell });

t.true(typeof shescape.quote === "function");

const input = "Hello world!";
const result = shescape.quote(input);
t.is(typeof result, "string");
});

test("has a working `quoteAll` function", (t) => {
const shescape = new Shescape({ shell: t.context.quoteShell });

t.true(typeof shescape.quoteAll === "function");

const inputs = ["foo", "bar"];
const result = shescape.quoteAll(inputs);
for (const output of result) {
t.is(typeof output, "string");
}
});

testProp(
"Shescape#escape",
[arbitrary.shescapeOptions(), arbitrary.shescapeArg()],
Expand Down

0 comments on commit 3471de0

Please sign in to comment.