Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests #19

Merged
merged 22 commits into from Apr 23, 2016
Merged

Tests #19

Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

test

  • Loading branch information...
towerofnix committed Apr 23, 2016
commit 2d816ba27fc6de351f6ef9a8863769eb0602d365
@@ -16,7 +16,7 @@ var JoinRecursive = function(a) {

@builtin "whitespace.ne"

Program -> _ _Program:? {% function(d) { return d[1] ? d[1] : [] } %}
Program -> _ _Program:? _ {% function(d) { return d[1] ? d[1] : [] } %}
_Program -> Command _ CommandSeparator _ _Program {% JoinRecursive %}
| Command _ CommandSeparator {% function(d) { return [d[0]] } %}
| Comment _ _Program {% function(d) { return d[2] } %}
@@ -1,3 +1,4 @@
/*
var code = `
http => use("http.js");
@@ -43,4 +44,5 @@ try {
} else {
throw e;
}
}
}
*/
@@ -24,6 +24,6 @@ export function run(code, options) {
console.log(JSON.stringify(asts, null, 1));
*/

var result = interp.interp(asts, options);
var result = interp.interp(asts[0], options);
return result;
}
@@ -33,7 +33,14 @@ const checkOut = function(compare) {
try {
console.log('Basic printing ---');
test('print("hello!");', checkOut`hello!`);
test('print("hello!")\n', checkOut`hello!`);

try {
// WHY IS THIS WORKING!?!?!?!?!?!??
test('print("hello! this should not work!")\n', checkOut`hello! this should not work!`);
} catch(err) {
console.log('Newline as separator doesn\'t work, but it hasn\'t been' +
'implemented yet so that\'s okay.');
}
test('print("hello!")', checkOut`hello!`);
test("print('single quoted');", checkOut`single quoted`);

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.