import mir.deser.text.tokenizer : tokenizeString; import mir.deser.text.tokens : IonTokenType; void testVal(IonTokenType token)(string ts, string expected, char after) { auto t = tokenizeString(ts); assert(t.nextToken()); assert(t.currentToken == token); auto v = readValue!(token)(t); assert(v.matchedText == expected); assert(t.readInput() == after); } with (IonTokenType) { testVal!(TokenNumber)("123123", "123123", 0); }