MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / test

Function test

utils/dasFormatter/main.cpp:252–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252int test() {
253 TextPrinter tp;
254 auto cases = test_cases();
255 int ret_code = 0;
256 for (const auto &[in, out, cfg]: cases) {
257 auto res = transform_syntax("test.das", in, cfg); // any filename
258 if (!res.ok) {
259 tp << "input:\n" << in << " \noutput:\n" << res.error->content << " \nerror:\n" << res.error->what
260 << "\n";
261 ret_code = -1;
262 } else if (res.ok != out) {
263 tp << " output:\n" << res.ok.value() << "\nexpected:\n" << out << "\n";
264 ret_code = -1;
265 }
266 }
267 return ret_code;
268}
269
270int main(int argc, char** argv) {
271 format::FormatOptions opts;

Callers 12

mainFunction · 0.70
dropdowns.spec.jsFile · 0.50
splitter.spec.jsFile · 0.50
share.spec.jsFile · 0.50
tabs.spec.jsFile · 0.50

Calls 3

test_casesFunction · 0.85
transform_syntaxFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected