Skip to content

Commit b196f5b

Browse files
committed
test.cpp: test with char buffer
1 parent 1126326 commit b196f5b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
enum Input {
2222
Stringstream,
2323
Fstream,
24-
File
24+
File,
25+
CharBuffer
2526
};
2627

2728
static Input USE_INPUT = Stringstream;
@@ -49,6 +50,8 @@ static const char* inputString(Input input) {
4950
return "Fstream";
5051
case File:
5152
return "File";
53+
case CharBuffer:
54+
return "CharBuffer";
5255
}
5356
}
5457

@@ -133,6 +136,8 @@ static simplecpp::TokenList makeTokenList(const char code[], std::size_t size, s
133136
return makeTokenListFromFstream(code, size, filenames, filename, outputList);
134137
case File:
135138
return makeTokenListFromFile(code, size, filenames, filename, outputList);
139+
case CharBuffer:
140+
return simplecpp::TokenList(code, size, filenames, filename, outputList);
136141
}
137142
}
138143

@@ -3023,5 +3028,6 @@ int main(int argc, char **argv)
30233028
runTests(argc, argv, Stringstream);
30243029
runTests(argc, argv, Fstream);
30253030
runTests(argc, argv, File);
3031+
runTests(argc, argv, CharBuffer);
30263032
return numberOfFailedAssertions > 0 ? EXIT_FAILURE : EXIT_SUCCESS;
30273033
}

0 commit comments

Comments
 (0)