Skip to content

Commit

Permalink
tests [made]: Made unit tests for literals
Browse files Browse the repository at this point in the history
Made unit tests for testing if literals construct without error.
And best of all it works beautifully, I'll be making a lot more
commits with a lot of more test suites soon.

Again @The-Quill gets full credit as he did almost everything
  • Loading branch information
Downgoat committed Jun 17, 2016
1 parent 73a4ee2 commit 6ba6350
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -5,7 +5,7 @@ build:
install:
./bin/install
test:
./node_modules/.bin/babel-istanbul cover _mocha test/**/*.js
babel-node ./node_modules/.bin/babel-istanbul cover _mocha
clean:
rm -rf ./dist/
.PHONY: test
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -10,7 +10,7 @@
"prepublish": "./node_modules/.bin/grunt build --minify",
"build": "./node_modules/.bin/grunt build",
"test": "make test",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
"coveralls": "make test && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
},
"devDependencies": {
"babel-cli": "^6.10.1",
Expand Down
11 changes: 11 additions & 0 deletions test/cheddar/literals.cdr
@@ -0,0 +1,11 @@
"string";
'string';
123;
123.456;
0b101;
0o777;
0xFF;
true;
false;
[1,2,3];
[1, 2, 3];
2 changes: 1 addition & 1 deletion test/tests/config/alias.js
Expand Up @@ -24,6 +24,6 @@ var Alias = require('../../../src/interpreter/core/config/alias.es6');

describe('alias config', () => {
it ('should provide a correct result', () => {
Alias.should.equal(result);
Alias.should.deep.equal(result);
})
})
11 changes: 10 additions & 1 deletion test/tests/cast.js → test/tests/expr.js
Expand Up @@ -25,17 +25,26 @@ function TestCheddar(file, result) {
})
);

STDOUT.should.equal('1+1=2\n');
STDOUT.should.equal(result ? result + '\n' : "");

console.log = c;
}
}

describe('Expressions', () => {
/*== CASTING ==*/
describe('casting', () => {
it('should cast to string', TestCheddar(
'casting.cdr',
'1+1=2'
))
})

/*== OPERATORS ==*/
describe('literals', () => {
it('should not error', TestCheddar(
'literals.cdr',
''
))
})
});

0 comments on commit 6ba6350

Please sign in to comment.