diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-23 22:42:00 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-23 22:42:00 -0500 |
| commit | e6a1697802135bf29a1ed50074d9244653235e4b (patch) | |
| tree | 09e42c10cf02ac8ac4dcb1b49d45568c838058bc /js/tests/reader.js | |
| parent | 37b97ee7a874b4b881733477e4633914f41d1106 (diff) | |
| download | mal-e6a1697802135bf29a1ed50074d9244653235e4b.tar.gz mal-e6a1697802135bf29a1ed50074d9244653235e4b.zip | |
JS: Fix internal tests.
Thanks: Wes Brown <wesbrown18@gmail.com>.
Diffstat (limited to 'js/tests/reader.js')
| -rw-r--r-- | js/tests/reader.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/tests/reader.js b/js/tests/reader.js index 2aa81c6..132ec4f 100644 --- a/js/tests/reader.js +++ b/js/tests/reader.js @@ -1,9 +1,10 @@ common = require('./common.js'); types = require('../types'); reader = require('../reader'); +core = require('../core'); var assert_eq = common.assert_eq, read_str = reader.read_str, - nth = types.ns.nth; + nth = core.ns.nth; console.log("Testing read of constants/strings"); assert_eq(2,read_str('2')); @@ -13,7 +14,7 @@ assert_eq('abc',read_str('"abc"')); assert_eq('a string (with parens)',read_str('"a string (with parens)"')); console.log("Testing read of symbols"); -assert(types.symbol_Q(read_str('abc'))); +assert(types._symbol_Q(read_str('abc'))); assert_eq('abc',read_str('abc').value); assert_eq('.',read_str('.').value); @@ -32,11 +33,11 @@ assert_eq('"xyz"',read_str('"\\"xyz\\""')); console.log("Testing READ_STR of lists"); -assert_eq(2,types.ns.count(read_str('(2 3)'))); -assert_eq(2,types.ns.first(read_str('(2 3)'))); -assert_eq(3,types.ns.first(types.ns.rest(read_str('(2 3)')))); +assert_eq(2,core.ns.count(read_str('(2 3)'))); +assert_eq(2,core.ns.first(read_str('(2 3)'))); +assert_eq(3,core.ns.first(core.ns.rest(read_str('(2 3)')))); L = read_str('(+ 1 2 "str1" "string (with parens) and \'single quotes\'")'); -assert_eq(5,types.ns.count(L)); +assert_eq(5,core.ns.count(L)); assert_eq('str1',nth(L,3)); assert_eq('string (with parens) and \'single quotes\'',nth(L,4)); assert_eq([2,3],read_str('(2 3)')); |
