Example #1
0
 it('write/read', function (done) {
   this.timeout(120000);
   var tmpfile = ts.openSync({dir: __dirname});
   trie.write(tmpfile.fd);
   fs.closeSync(tmpfile.fd);
   var fd = fs.openSync(tmpfile.path, 'r');
   trie.read(fd);
   fs.closeSync(fd);
   tmpfile.unlink();
   should(trie.size()).equal(expectedTrieSize);
   done();
 });
Example #2
0
 it('Marisa::Trie::read', function () {
   var trie = new Marisa.Trie();
   should(trie.read).be.a.Function();
   should(trie.read).throw();
   var fd = fs.openSync(simpleDataPath, 'r');
   should(trie.read(fd)).be.undefined();
   fs.closeSync(fd);
   should(trie.size()).equal(expectedTrieSize);
   testLookup(trie, keyset);
   should(function () { trie.read(); }).throw();
   should(function () { trie.read({}); }).throw();
   should(function () { trie.read.call({}, agent); }).throw();
 });
Example #3
0
 should(function () { trie.read({}); }).throw();