1.5 KiB
1.5 KiB
title | description | menu | weight | flux/v0/tags | introduced | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
testing.assertMatches() function | `testing.assertMatches()` tests whether a string matches a given regex. |
|
201 |
|
LATEST |
testing.assertMatches()
tests whether a string matches a given regex.
Function type signature
(got: string, want: regexp) => stream[{v: string, _diff: string}]
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
Parameters
got
({{< req >}}) Value to test.
want
({{< req >}}) Regex to test against.
Examples
Test if two values are equal
import "internal/testing"
testing.assertMatches(got: "123", want: /12/)