mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-11 02:59:34 -06:00
Now the generated code is tested and most things work. To generate a .noms.js file use the codegen go binary Things that are not complete/needs improvements include: - Recursive structs - Structs with annonymous unions - Enum -- constants for the values Issue #1081
21 lines
468 B
JavaScript
21 lines
468 B
JavaScript
// @flow
|
|
|
|
import {assert} from 'chai';
|
|
import {suite, test} from 'mocha';
|
|
|
|
import {Kind} from '@attic/noms';
|
|
import {Struct} from './gen/struct.noms.js';
|
|
|
|
suite('struct.noms', () => {
|
|
test('constructor', () => {
|
|
const s: Struct = new Struct({s: 'hi', b: true});
|
|
assert.equal(s.s, 'hi');
|
|
assert.equal(s.b, true);
|
|
});
|
|
|
|
test('type', () => {
|
|
const s: Struct = new Struct({s: 'hi', b: true});
|
|
assert.equal(s.type.kind, Kind.Unresolved);
|
|
});
|
|
});
|