1 /**
2 Copyright: Copyright (c) 2018, Joakim Brännström. All rights reserved.
3 License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
4 Author: Joakim Brännström (joakim.brannstrom@gmx.com)
5 
6 // #TST-plugin_mutate_statement_del_call_expression
7 */
8 module dextool_test.mutate_stmt_deletion;
9 
10 import dextool_test.utility;
11 
12 // dfmt off
13 
14 @("shall successfully run the ABS mutator (no validation of the result)")
15 unittest {
16     mixin(EnvSetup(globalTestdir));
17 
18     makeDextoolAnalyze(testEnv)
19         .addInputArg(testData ~ "statement_deletion.cpp")
20         .run;
21     auto r = makeDextool(testEnv)
22         .addArg(["test"])
23         .addArg(["--mutant", "sdl"])
24         .run;
25 }
26 
27 @("shall delete function calls")
28 unittest {
29     mixin(EnvSetup(globalTestdir));
30 
31     makeDextoolAnalyze(testEnv)
32         .addInputArg(testData ~ "sdl_func_call.cpp")
33         .run;
34     auto r = makeDextool(testEnv)
35         .addArg(["test"])
36         .addArg(["--mutant", "sdl"])
37         .run;
38 
39     testAnyOrder!SubStr([
40         "'gun()' to '/*gun()*/'",
41         "'wun(5)' to '/*wun(5)*/'",
42         "'calc(6)' to '/*calc(6)*/'",
43         "'wun(calc(6))' to '/*wun(calc(6))*/'",
44         "'calc(7)' to '/*calc(7)*/'",
45         "'calc(8)' to '/*calc(8)*/'",
46         "'calc(10)' to '/*calc(10)*/'",
47         "'calc(11)' to '/*calc(11)*/'",
48     ]).shouldBeIn(r.stdout);
49 }