Skip to content

Commit

Permalink
feat(#97): add test for chained commands
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Jan 27, 2023
1 parent 6c94848 commit b63ef5b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/commands/test_compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,35 @@ describe('compile', function() {
);
done();
});

it('Cleans and compiles a simple .EO program', function(done) {
home = path.resolve('temp/test-compile/simple');
fs.rmSync(home, {recursive: true, force: true});
fs.mkdirSync(path.resolve(home, 'src'), {recursive: true});
fs.writeFileSync(
path.resolve(home, 'src/simple.eo'),
[
'+package foo.bar',
'+alias org.eolang.io.stdout',
'',
'[args...] > app',
' stdout "Hello, world!" > @',
].join('\n')
);
const stdout = runSync([
'clean', 'compile', '-s', path.resolve(home, 'src'), '-t', path.resolve(home, 'target'),
]);
assertFilesExist(
stdout, home,
[
'target/generated-sources/EOfoo/EObar/EOapp.java',
'target/generated-sources/EOorg/EOeolang/EObytes.java',
'target/classes/EOfoo/EObar/EOapp.class',
'target/classes/org/eolang/Phi.class',
'target/classes/EOorg/EOeolang/EOint.class',
]
);
assert(!fs.existsSync(path.resolve('../../mvnw/target')));
done();
});
});

0 comments on commit b63ef5b

Please sign in to comment.