File tree 7 files changed +27
-46
lines changed
7 files changed +27
-46
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ import fs from "fs" ;
2
+ import color from "cli-color" ;
3
+ import { diffString } from "json-diff" ;
4
+
5
+ export function readdir ( path ) {
6
+ return new Promise ( function ( resolve , reject ) {
7
+ fs . readdir ( path , function ( err , filenames ) {
8
+ return err ? reject ( err ) : resolve ( filenames ) ;
9
+ } ) ;
10
+ } ) ;
11
+ }
12
+
13
+ export function readfile ( path ) {
14
+ return new Promise ( function ( resolve , reject ) {
15
+ fs . readFile ( path , function ( err , file ) {
16
+ return err ? reject ( err ) : resolve ( file . toString ( ) ) ;
17
+ } ) ;
18
+ } ) ;
19
+ }
20
+
21
+ export const diff = diffString ;
22
+ export const PASS = color . green ( "PASS" ) ;
23
+ export const FAIL = color . red ( "FAIL" ) ;
Original file line number Diff line number Diff line change 1
1
import color from "cli-color" ;
2
2
import difflib from "difflib" ;
3
- import { FAIL , PASS , readfile } from "../../test/harness /util.js" ;
4
- import ebnf from "../lib/ebnf.js/index.js " ;
3
+ import { FAIL , PASS , readfile } from "../lib /util.js" ;
4
+ import ebnf from "../lib/ebnf.js" ;
5
5
6
6
let args = process . argv . slice ( 2 ) ;
7
7
Original file line number Diff line number Diff line change 1
1
import { NumberLiteral , StringLiteral } from "../../syntax/parser/grammar.js" ;
2
- import suite from "../../test/harness /suite.js" ;
2
+ import suite from "../lib /suite.js" ;
3
3
4
4
if ( process . argv . length > 2 ) {
5
5
console . error ( "Usage: node -r esm literals.js" ) ;
Original file line number Diff line number Diff line change 1
1
import assert from "assert" ;
2
2
import { Resource } from "../../syntax/parser/grammar.js" ;
3
- import { test_fixtures , validate_json } from "../../test/harness /fixture.js" ;
3
+ import { test_fixtures , validate_json } from "../lib /fixture.js" ;
4
4
5
5
const fixtures_dir = process . argv [ 2 ] ;
6
6
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments