Skip to content

Commit

Permalink
Remove test/harness
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Jul 31, 2019
1 parent 34d0198 commit fffd78a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 46 deletions.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions syntax/lib/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import fs from "fs";
import color from "cli-color";
import {diffString} from "json-diff";

export function readdir(path) {
return new Promise(function(resolve, reject) {
fs.readdir(path, function(err, filenames) {
return err ? reject(err) : resolve(filenames);
});
});
}

export function readfile(path) {
return new Promise(function(resolve, reject) {
fs.readFile(path, function(err, file) {
return err ? reject(err) : resolve(file.toString());
});
});
}

export const diff = diffString;
export const PASS = color.green("PASS");
export const FAIL = color.red("FAIL");
4 changes: 2 additions & 2 deletions syntax/test/ebnf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import color from "cli-color";
import difflib from "difflib";
import { FAIL, PASS, readfile } from "../../test/harness/util.js";
import ebnf from "../lib/ebnf.js/index.js";
import { FAIL, PASS, readfile } from "../lib/util.js";
import ebnf from "../lib/ebnf.js";

let args = process.argv.slice(2);

Expand Down
2 changes: 1 addition & 1 deletion syntax/test/literals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NumberLiteral, StringLiteral } from "../../syntax/parser/grammar.js";
import suite from "../../test/harness/suite.js";
import suite from "../lib/suite.js";

if (process.argv.length > 2) {
console.error("Usage: node -r esm literals.js");
Expand Down
2 changes: 1 addition & 1 deletion syntax/test/parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "assert";
import { Resource } from "../../syntax/parser/grammar.js";
import { test_fixtures, validate_json } from "../../test/harness/fixture.js";
import { test_fixtures, validate_json } from "../lib/fixture.js";

const fixtures_dir = process.argv[2];

Expand Down
42 changes: 0 additions & 42 deletions test/harness/util.js

This file was deleted.

0 comments on commit fffd78a

Please sign in to comment.