Documentation ¶
Overview ¶
Package wildcards implements helper to compare text with wildcards in tests.
Inspired by PhpUnit "assertStringMatchesFormat".
Supported wildcards: %e: Represents a directory separator, for example / on Linux. %s: One or more of anything (character or white space) except the end of line character. %S: Zero or more of anything (character or white space) except the end of line character. %a: One or more of anything (character or white space) including the end of line character. %A: Zero or more of anything (character or white space) including the end of line character. %w: Zero or more white space characters. %i: A signed integer value, for example +3142, -3142. %d: An unsigned integer value, for example 123456. %x: One or more hexadecimal character. That is, characters in the range 0-9, a-f, A-F. %f: A floating point number, for example: 3.142, -3.142, 3.142E-10, 3.142e+10. %c: A single character of any sort. %%: A literal percent character: %.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert compares two texts and allows using wildcards in expected value, see ToRegexp function.
func Compare ¶ added in v0.2.0
Compare compares two texts and allows using wildcards in expected value, see ToRegexp function.
func EscapeWhitespaces ¶
EscapeWhitespaces escapes all whitespaces except new line -> for clearer difference in diff output.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.