diff options
author | 2022-11-21 17:02:21 -0800 | |
---|---|---|
committer | 2022-11-21 17:02:43 -0800 | |
commit | a274ddba3af6d7438508b0ee97a467fc14505efd (patch) | |
tree | 5a85b038bbde59aa46158bedc583f943190310fd /test/bun.js/sqlite.test.js | |
parent | 8e36485a76d0ec3406245287c87df7111afee9bc (diff) | |
download | bun-a274ddba3af6d7438508b0ee97a467fc14505efd.tar.gz bun-a274ddba3af6d7438508b0ee97a467fc14505efd.tar.zst bun-a274ddba3af6d7438508b0ee97a467fc14505efd.zip |
[bun:test] Add test for returning MAX_SAFE_INTEGER
Diffstat (limited to 'test/bun.js/sqlite.test.js')
-rw-r--r-- | test/bun.js/sqlite.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bun.js/sqlite.test.js b/test/bun.js/sqlite.test.js index 4ca236819..2bf7fc72d 100644 --- a/test/bun.js/sqlite.test.js +++ b/test/bun.js/sqlite.test.js @@ -134,6 +134,15 @@ it("creates", () => { stmt2.finalize(); }); +it("int52", () => { + const db = Database.open(":memory:"); + db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, int64 INTEGER)"); + db.run("INSERT INTO test (int64) VALUES (?)", Number.MAX_SAFE_INTEGER); + expect(db.query("SELECT * FROM test").get().int64).toBe( + Number.MAX_SAFE_INTEGER, + ); +}); + it("typechecks", () => { const db = Database.open(":memory:"); db.exec("CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT)"); |