No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
330a682
... +0 ...
e0acce4
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
492 | 492 | assert(w.data == `\x03`); |
|
493 | 493 | } |
|
494 | 494 | ||
495 | + | /// |
|
496 | + | void printReplaced(C, W)(scope ref W w, scope const(C)[] str, C c, scope const(C)[] to) |
|
497 | + | { |
|
498 | + | import mir.string: scanLeftAny; |
|
499 | + | ||
500 | + | while (str.length) |
|
501 | + | { |
|
502 | + | auto tailLen = str.scanLeftAny(c).length; |
|
503 | + | print(w, str[0 .. $ - tailLen]); |
|
504 | + | if (tailLen == 0) |
|
505 | + | break; |
|
506 | + | print(w, to); |
|
507 | + | str = str[$ - tailLen + 1 .. $]; |
|
508 | + | } |
|
509 | + | } |
|
510 | + | ||
511 | + | /// |
|
512 | + | @safe pure nothrow |
|
513 | + | unittest |
|
514 | + | { |
|
515 | + | import mir.test: should; |
|
516 | + | auto csv = stringBuf; |
|
517 | + | csv.put('"'); |
|
518 | + | csv.printReplaced(`some string with " double quotes "!`, '"', `""`); |
|
519 | + | csv.put('"'); |
|
520 | + | csv.data.should == `"some string with "" double quotes ""!"`; |
|
521 | + | } |
|
522 | + | ||
495 | 523 | /++ |
|
496 | 524 | Decodes `char` `c` to the form `u00XX`, where `XX` is 2 hexadecimal characters. |
|
497 | 525 | +/ |
32 | 32 | version (LDC) |
|
33 | 33 | static if (N <= 8) |
|
34 | 34 | static if (is(__vector(U[N]))) |
|
35 | + | if (!__ctfe) |
|
35 | 36 | { |
|
36 | 37 | alias V = __vector(U[N]); |
|
37 | 38 | pragma(msg, V); |
102 | 103 | version (LDC) |
|
103 | 104 | static if (N <= 8) |
|
104 | 105 | static if (is(__vector(U[N]))) |
|
106 | + | if (!__ctfe) |
|
105 | 107 | { |
|
106 | 108 | import mir.bitop: cttz; |
|
107 | 109 |
207 | 209 | version (LDC) |
|
208 | 210 | static if (N <= 8) |
|
209 | 211 | static if (is(__vector(U[N]))) |
|
212 | + | if (!__ctfe) |
|
210 | 213 | { |
|
211 | 214 | import mir.bitop: ctlz; |
|
212 | 215 |
296 | 299 | inout(C)[] |
|
297 | 300 | strip(C, size_t L) |
|
298 | 301 | (return scope inout(C)[] str, const C[L] chars...) |
|
299 | - | @trusted pure nothrow @nogc |
|
302 | + | @safe pure nothrow @nogc |
|
300 | 303 | if (isSomeChar!C && L) |
|
301 | 304 | { |
|
302 | 305 | return str.stripLeft(chars).stripRight(chars); |
e0acce4
330a682