File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,28 @@ t @@ fun () -> not (suffix ~suf:"cd" "abcde");;
229
229
t @@ fun () -> not (suffix ~suf: " abcd" " cd" );;
230
230
eq (" ab" , " cd" ) (take_drop 2 " abcd" );;
231
231
eq (" abc" , " " ) (take_drop 3 " abc" );;
232
- eq (" abc" , " " ) (take_drop 5 " abc" )
232
+ eq (" abc" , " " ) (take_drop 5 " abc" );;
233
+
234
+ q
235
+ Q. (printable_string)
236
+ (fun s ->
237
+ let predicate c = Char. code c mod 2 = 0 in
238
+ let prefix = take_while predicate s in
239
+ let suffix = drop_while predicate s in
240
+ if prefix ^ suffix <> s then
241
+ Q.Test. fail_reportf " s=%S, pre=%S, post=%S" s prefix suffix;
242
+ true )
243
+ ;;
244
+
245
+ q
246
+ Q. (printable_string)
247
+ (fun s ->
248
+ let predicate c = Char. code c mod 2 = 0 in
249
+ let prefix = rdrop_while predicate s in
250
+ let suffix = rtake_while predicate s in
251
+ if prefix ^ suffix <> s then
252
+ Q.Test. fail_reportf " s=%S, pre=%S, post=%S" s prefix suffix;
253
+ true )
233
254
234
255
let eq' = eq ~printer: Q.Print. (option string );;
235
256
You can’t perform that action at this time.
0 commit comments