@@ -35,14 +35,17 @@ Set seed and (full) mutation rate as environment variables, for repeatability
35
35
36
36
Preprocess, check for attribute and error
37
37
$ bash .. / filter_dune_build. sh ./ test. bc -- instrument-with mutaml 2 > &1 > output. txt
38
- $ head -n 4 output. txt && echo " ERROR MESSAGE" && tail -n 9 output. txt
38
+ $ head -n 4 output. txt && echo " ERROR MESSAGE" && tail -n 12 output. txt
39
39
Running mutaml instrumentation on " test.ml"
40
40
Randomness seed: 896745231 Mutation rate: 100 GADTs enabled: true
41
41
Created 0 mutations of test. ml
42
42
Writing mutation info to test. muts
43
43
ERROR MESSAGE
44
-
45
44
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
45
+ let __is_mutaml_mutant__ m =
46
+ match __MUTAML_MUTANT__ with
47
+ | None -> false
48
+ | Some mutant -> String. equal m mutant
46
49
let greet () = print_endline (" Hello," ^ " world!" )[@@ ppwarning
47
50
" Stop using hello world!" ]
48
51
let () = greet ()
@@ -70,6 +73,10 @@ Preprocess, check that attribute no longer triggers an error
70
73
$ bash .. / filter_dune_build. sh ./ test. bc -- instrument-with mutaml
71
74
72
75
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
76
+ let __is_mutaml_mutant__ m =
77
+ match __MUTAML_MUTANT__ with
78
+ | None -> false
79
+ | Some mutant -> String. equal m mutant
73
80
let greet () = print_endline (" Hello," ^ " world!" )[@@ ppwarning
74
81
" Stop using hello world!" ]
75
82
let () = greet ()
@@ -102,13 +109,17 @@ Create a test.ml file with a module attribute
102
109
Preprocess, check that attribute triggers deprecation error
103
110
104
111
$ bash .. / filter_dune_build. sh ./ test. bc -- instrument-with mutaml 2 > &1 > output. txt
105
- $ head -n 4 output. txt && echo " ERROR MESSAGE" && tail -n 10 output. txt
112
+ $ head -n 4 output. txt && echo " ERROR MESSAGE" && tail -n 14 output. txt
106
113
Running mutaml instrumentation on " test.ml"
107
114
Randomness seed: 896745231 Mutation rate: 100 GADTs enabled: true
108
115
Created 0 mutations of test. ml
109
116
Writing mutation info to test. muts
110
117
ERROR MESSAGE
111
118
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
119
+ let __is_mutaml_mutant__ m =
120
+ match __MUTAML_MUTANT__ with
121
+ | None -> false
122
+ | Some mutant -> String. equal m mutant
112
123
module T :
113
124
sig val greet : unit -> unit[@@ deprecated "Please stop using that example" ]
114
125
end = struct let greet () = print_endline (" Hello," ^ " world!" ) end
@@ -149,6 +160,10 @@ Preprocess, check for attribute and error
149
160
Writing mutation info to test. muts
150
161
151
162
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
163
+ let __is_mutaml_mutant__ m =
164
+ match __MUTAML_MUTANT__ with
165
+ | None -> false
166
+ | Some mutant -> String. equal m mutant
152
167
let v = ((())[@ testattr " unit attr" ])
153
168
154
169
@@ -169,12 +184,16 @@ Preprocess, check for attribute and error
169
184
Writing mutation info to test. muts
170
185
171
186
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
187
+ let __is_mutaml_mutant__ m =
188
+ match __MUTAML_MUTANT__ with
189
+ | None -> false
190
+ | Some mutant -> String. equal m mutant
172
191
let t =
173
- if __MUTAML_MUTANT__ = (Some " test:0" )
192
+ if __is_mutaml_mutant__ " test:0"
174
193
then ((false)[@ testattr " true attr" ])
175
194
else ((true)[@ testattr " true attr" ])
176
195
let f =
177
- if __MUTAML_MUTANT__ = (Some " test:1" )
196
+ if __is_mutaml_mutant__ " test:1"
178
197
then ((true)[@ testattr " false attr" ])
179
198
else ((false)[@ testattr " false attr" ])
180
199
@@ -195,8 +214,12 @@ Preprocess, check for attribute and error
195
214
Writing mutation info to test. muts
196
215
197
216
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
217
+ let __is_mutaml_mutant__ m =
218
+ match __MUTAML_MUTANT__ with
219
+ | None -> false
220
+ | Some mutant -> String. equal m mutant
198
221
let str =
199
- if __MUTAML_MUTANT__ = (Some " test:0" )
222
+ if __is_mutaml_mutant__ " test:0"
200
223
then ((" " )[@ testattr " str attr" ])
201
224
else ((" " )[@ testattr " str attr" ])
202
225
@@ -217,8 +240,12 @@ Preprocess, check for attribute and error
217
240
Writing mutation info to test. muts
218
241
219
242
let __MUTAML_MUTANT__ = Stdlib. Sys. getenv_opt " MUTAML_MUTANT"
243
+ let __is_mutaml_mutant__ m =
244
+ match __MUTAML_MUTANT__ with
245
+ | None -> false
246
+ | Some mutant -> String. equal m mutant
220
247
let f x =
221
- if __MUTAML_MUTANT__ = (Some " test:0" )
248
+ if __is_mutaml_mutant__ " test:0"
222
249
then ((x )[@ testattr " str attr" ])
223
250
else ((x + 1 )[@ testattr " str attr" ])
224
251
0 commit comments