mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-30 07:02:24 +00:00
Fix CRLF issues in tests; Include common tsc options in asc bundle
This commit is contained in:
@ -69,12 +69,12 @@ tests.forEach(filename => {
|
||||
console.log();
|
||||
if (err)
|
||||
stderr.write(err + os.EOL);
|
||||
var actual = stdout.toString().replace(/\r\n/g, "\n");
|
||||
if (args.create) {
|
||||
fs.writeFileSync(path.join(basedir, basename + ".wast"), stdout.toString(), { encoding: "utf8" });
|
||||
fs.writeFileSync(path.join(basedir, basename + ".wast"), actual, { encoding: "utf8" });
|
||||
console.log("- " + chalk.yellow("Created fixture"));
|
||||
} else {
|
||||
let actual = stdout.toString();
|
||||
let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" });
|
||||
let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" }).replace(/\r\n/g, "\n");
|
||||
let diffs = diff(basename + ".wast", expected, actual);
|
||||
if (diffs !== null) {
|
||||
console.log(diffs);
|
||||
|
@ -27,14 +27,14 @@ glob.sync(filter, { cwd: __dirname + "/parser" }).forEach(filename => {
|
||||
|
||||
var sb = [];
|
||||
serializeSource(parser.program.sources[0], sb);
|
||||
var actual = sb.join("") + parser.diagnostics.map(diagnostic => "// " + diagnostic + "\n").join("");;
|
||||
var actual = sb.join("") + parser.diagnostics.map(diagnostic => "// " + diagnostic + "\n").join("");
|
||||
var fixture = filename + ".fixture.ts";
|
||||
|
||||
if (isCreate) {
|
||||
fs.writeFileSync(__dirname + "/parser/" + fixture, actual, { encoding: "utf8" });
|
||||
console.log("Created\n");
|
||||
} else {
|
||||
var expected = fs.readFileSync(__dirname + "/parser/" + fixture, { encoding: "utf8" });
|
||||
var expected = fs.readFileSync(__dirname + "/parser/" + fixture, { encoding: "utf8" }).replace(/\r\n/g, "\n");
|
||||
var diffs = diff("parser/" + fixture, expected, actual);
|
||||
if (diffs !== null) {
|
||||
failed = true;
|
||||
|
Reference in New Issue
Block a user