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
18 lines
473 B
JavaScript
18 lines
473 B
JavaScript
// @flow
|
|
|
|
import {assert} from 'chai';
|
|
import {suite, test} from 'mocha';
|
|
import {EnumStruct} from './gen/enum_struct.noms.js';
|
|
import type {Handedness} from './gen/enum_struct.noms.js';
|
|
|
|
suite('enum_struct.noms', () => {
|
|
test('constructor', async () => {
|
|
const es = new EnumStruct({hand: 0});
|
|
assert.equal(es.hand, 0);
|
|
const hand: Handedness = es.hand;
|
|
assert.equal(es.hand, hand);
|
|
const es2 = es.setHand(1);
|
|
assert.equal(es2.hand, 1);
|
|
});
|
|
});
|