mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 22:09:32 -06:00
Get marshalling of integers working
This commit is contained in:
@@ -206,3 +206,29 @@ describe('abstract syntax', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
describe('expressions', () => {
|
||||
test('small integer', () => {
|
||||
const e1 = PGF.readExpr('123')
|
||||
const e2 = new PGF.ExprLit(123)
|
||||
const e3 = new PGF.ExprLit(456)
|
||||
expect(e1).toEqual(e2)
|
||||
expect(e1).not.toEqual(e3)
|
||||
})
|
||||
|
||||
test.skip('negative integer', () => {
|
||||
const e1 = PGF.readExpr('-123')
|
||||
const e2 = new PGF.ExprLit(-123)
|
||||
const e3 = new PGF.ExprLit(-456)
|
||||
expect(e1).toEqual(e2)
|
||||
expect(e1).not.toEqual(e3)
|
||||
})
|
||||
|
||||
// test.only('big integer', () => {
|
||||
// const e1 = PGF.readExpr('774763251095801167872')
|
||||
// const e2 = new PGF.ExprLit(BigInt(774763251095801167872))
|
||||
// expect(e1).toEqual(e2)
|
||||
// })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user