remove match param (#127)

This commit is contained in:
water111
2020-11-20 20:17:37 -05:00
committed by GitHub
parent 953c1512db
commit 29e4ff9e51
9 changed files with 33 additions and 38 deletions
+4 -4
View File
@@ -38,7 +38,7 @@ void CompilerTestRunner::run_static_test(inja::Environment& env,
std::string& testCategory,
const std::string& test_file,
const std::vector<std::string>& expected,
MatchParam<int> truncate) {
std::optional<int> truncate) {
env.write(test_file, {}, test_file);
run_test(testCategory, test_file, expected, truncate);
}
@@ -46,13 +46,13 @@ void CompilerTestRunner::run_static_test(inja::Environment& env,
void CompilerTestRunner::run_test(const std::string& test_category,
const std::string& test_file,
const std::vector<std::string>& expected,
MatchParam<int> truncate) {
std::optional<int> truncate) {
fprintf(stderr, "Testing %s\n", test_file.c_str());
auto result =
c->run_test_from_file("test/goalc/source_generated/" + test_category + "/" + test_file);
if (!truncate.is_wildcard) {
if (truncate.has_value()) {
for (auto& x : result) {
x = x.substr(0, truncate.value);
x = x.substr(0, truncate.value());
}
}