void constant
This commit is contained in:
parent
b59120f6f5
commit
ff4b6fb5db
3 changed files with 3 additions and 2 deletions
|
@ -313,7 +313,7 @@ private:
|
||||||
|
|
||||||
kj::StringTree literalValue(schema::Type::Reader type, schema::Value::Reader value) {
|
kj::StringTree literalValue(schema::Type::Reader type, schema::Value::Reader value) {
|
||||||
switch (value.which()) {
|
switch (value.which()) {
|
||||||
case schema::Value::VOID: return kj::strTree(" ::capnp::VOID");
|
case schema::Value::VOID: return kj::strTree("org.capnproto.Void.VOID");
|
||||||
case schema::Value::BOOL: return kj::strTree(value.getBool() ? "true" : "false");
|
case schema::Value::BOOL: return kj::strTree(value.getBool() ? "true" : "false");
|
||||||
case schema::Value::INT8: return kj::strTree(value.getInt8());
|
case schema::Value::INT8: return kj::strTree(value.getInt8());
|
||||||
case schema::Value::INT16: return kj::strTree(value.getInt16());
|
case schema::Value::INT16: return kj::strTree(value.getInt16());
|
||||||
|
|
|
@ -33,6 +33,7 @@ class EncodingSuite extends FunSuite {
|
||||||
}
|
}
|
||||||
|
|
||||||
test("Constants") {
|
test("Constants") {
|
||||||
|
assert(Void.VOID == TestConstants.VOID_CONST);
|
||||||
assert(true == TestConstants.BOOL_CONST);
|
assert(true == TestConstants.BOOL_CONST);
|
||||||
assert(-123 == TestConstants.INT8_CONST);
|
assert(-123 == TestConstants.INT8_CONST);
|
||||||
assert(-12345 == TestConstants.INT16_CONST);
|
assert(-12345 == TestConstants.INT16_CONST);
|
||||||
|
|
|
@ -164,7 +164,7 @@ struct TestGroups {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TestConstants {
|
struct TestConstants {
|
||||||
# const voidConst :Void = void;
|
const voidConst :Void = void;
|
||||||
const boolConst :Bool = true;
|
const boolConst :Bool = true;
|
||||||
const int8Const :Int8 = -123;
|
const int8Const :Int8 = -123;
|
||||||
const int16Const :Int16 = -12345;
|
const int16Const :Int16 = -12345;
|
||||||
|
|
Loading…
Reference in a new issue