()
| 134 | } |
| 135 | |
| 136 | func testVariantRoundtrip() { |
| 137 | m := test.NamesById{1: "one"} |
| 138 | asMap := test.VariantRoundtrip(test.MakeMapOrStringAsMap(m)) |
| 139 | assertEqual(asMap.Tag(), test.MapOrStringAsMap) |
| 140 | assertEqual(asMap.AsMap()[1], "one") |
| 141 | |
| 142 | asStr := test.VariantRoundtrip(test.MakeMapOrStringAsString("hello")) |
| 143 | assertEqual(asStr.Tag(), test.MapOrStringAsString) |
| 144 | assertEqual(asStr.AsString(), "hello") |
| 145 | } |
| 146 | |
| 147 | func testResultRoundtrip() { |
| 148 | m := test.NamesById{5: "five"} |