diff --git a/test/testnt.cpp b/test/testnt.cpp index 131ee16b..1630e233 100644 --- a/test/testnt.cpp +++ b/test/testnt.cpp @@ -88,19 +88,27 @@ void testNTTable() auto top = nt::NTTable{} .add_column(TypeCode::Int32, "A", "Col A") + .add_column(TypeCode::String, "C", "Col C") .add_column(TypeCode::String, "B", "Col B") .create(); - shared_array labels({"Col A", "Col B"}); + shared_array labels({"Col A", "Col C", "Col B"}); testArrEq(top["labels"].as>(), labels); testTrue(top["value.A"].type()==TypeCode::Int32A); testTrue(top["value.B"].type()==TypeCode::StringA); + + std::vector names; + for(auto fld : top["value"].ichildren()) { + names.push_back(top.nameOf(fld)); + } + shared_array expect({"value.A", "value.C", "value.B"}); + testArrEq(shared_array(names.begin(), names.end()), expect); } } // namespace MAIN(testnt) { - testPlan(21); + testPlan(22); testNTScalar(); testNTNDArray(); testNTURI();