From 8be966c688e4c82bdfbf9316510fc2aea625247a Mon Sep 17 00:00:00 2001 From: Byakuren Hijiri Date: Wed, 29 May 2024 22:20:45 -0300 Subject: [PATCH] chore(test): Remove preceding extra newlines from expected outputs --- test/builtinDetectors.spec.ts | 3 ++- test/contracts/conditional-1.expected.out | 1 + test/contracts/linear-flow-1.expected.out | 1 + test/contracts/loops-1.expected.out | 1 + test/contracts/readonly-1.expected.out | 1 + test/contracts/readonly-2.expected.out | 3 +-- test/contracts/zero-address.expected.out | 3 +-- 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/builtinDetectors.spec.ts b/test/builtinDetectors.spec.ts index a29863d0..45202998 100644 --- a/test/builtinDetectors.spec.ts +++ b/test/builtinDetectors.spec.ts @@ -25,7 +25,8 @@ processTactFiles(CONTRACTS_DIR, (file) => { const runCommand = `node dist/src/main.js ${configPath}`; await new Promise((resolve, reject) => { exec(runCommand, (error, stdout, stderr) => { - fs.writeFileSync(outputFilePath, stdout + stderr); + const out = stdout.trim() + stderr.trim(); + fs.writeFileSync(outputFilePath, out ? out : "\n"); if (error) { reject(error); } else { diff --git a/test/contracts/conditional-1.expected.out b/test/contracts/conditional-1.expected.out index e69de29b..8b137891 100644 --- a/test/contracts/conditional-1.expected.out +++ b/test/contracts/conditional-1.expected.out @@ -0,0 +1 @@ + diff --git a/test/contracts/linear-flow-1.expected.out b/test/contracts/linear-flow-1.expected.out index e69de29b..8b137891 100644 --- a/test/contracts/linear-flow-1.expected.out +++ b/test/contracts/linear-flow-1.expected.out @@ -0,0 +1 @@ + diff --git a/test/contracts/loops-1.expected.out b/test/contracts/loops-1.expected.out index e69de29b..8b137891 100644 --- a/test/contracts/loops-1.expected.out +++ b/test/contracts/loops-1.expected.out @@ -0,0 +1 @@ + diff --git a/test/contracts/readonly-1.expected.out b/test/contracts/readonly-1.expected.out index e69de29b..8b137891 100644 --- a/test/contracts/readonly-1.expected.out +++ b/test/contracts/readonly-1.expected.out @@ -0,0 +1 @@ + diff --git a/test/contracts/readonly-2.expected.out b/test/contracts/readonly-2.expected.out index b40583c2..19f5b045 100644 --- a/test/contracts/readonly-2.expected.out +++ b/test/contracts/readonly-2.expected.out @@ -1,7 +1,6 @@ - test/contracts/readonly-2.tact:2:5: 1 | fun test1(): Int { > 2 | let a: Int = 20; ^ 3 | let b: Int = 22; -Variable is never used +Variable is never used \ No newline at end of file diff --git a/test/contracts/zero-address.expected.out b/test/contracts/zero-address.expected.out index e2ed4c94..980a2278 100644 --- a/test/contracts/zero-address.expected.out +++ b/test/contracts/zero-address.expected.out @@ -1,7 +1,6 @@ - test/contracts/zero-address.tact:3:23: 2 | init() { > 3 | newAddress(1, 0x000000000000000000000000000000000000000000000000); ^ 4 | } -Using zero address +Using zero address \ No newline at end of file