mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 13:59:31 -06:00
Add FFI bindings for all API functions. Implement getCategories and getFunctions
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import PGF from '../index'
|
||||
|
||||
// readPGF
|
||||
|
||||
test('readPGF successful', () => {
|
||||
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
|
||||
})
|
||||
@@ -10,7 +12,19 @@ test('readPGF missing file', () => {
|
||||
}).toThrow()
|
||||
})
|
||||
|
||||
// abstract syntax
|
||||
|
||||
test('abstract name', () => {
|
||||
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
|
||||
expect(gr.getAbstractName()).toBe('basic')
|
||||
})
|
||||
|
||||
test('categories', () => {
|
||||
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
|
||||
expect(gr.getCategories()).toEqual(['Float','Int','N','P','S','String'])
|
||||
})
|
||||
|
||||
test('functions', () => {
|
||||
let gr = PGF.readPGF('../haskell/tests/basic.pgf')
|
||||
expect(gr.getFunctions()).toEqual(['c','ind','s','z'])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user