Skip to content

Commit

Permalink
add a test for issue latitudegames#9
Browse files Browse the repository at this point in the history
It seems to work fine
  • Loading branch information
syonfox committed Dec 25, 2022
1 parent 81be7f0 commit d2b6dca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Encoder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ test('stats test', () => {
// const str = "toString constructor hasOwnProperty valueOf";
// expect(encode(str).length).toEqual(countTokens(str));
})
test('test " issue #9', () => {
const str = '“wrote jack a letter”'

let e = encode(str);
let stats = tokenStats(e);
// console.log("example stats: ", stats);
expect(e).toEqual([447, 250, 42910, 14509, 257, 3850, 447, 251])
expect(decode(e)).toEqual(str)
// const str = "toString constructor hasOwnProperty valueOf";
// expect(encode(str).length).toEqual(countTokens(str));
})

0 comments on commit d2b6dca

Please sign in to comment.