Documentation

testing.assertMatches() function

testing.assertMatches() tests whether a string matches a given regex.

Function type signature
(got: string, want: regexp) => stream[{v: string, _diff: string}]

For more information, see Function type signatures.

Parameters

got

(Required) Value to test.

want

(Required) Regex to test against.

Examples

Test if two values are equal

import "internal/testing"

testing.assertMatches(got: "123", want: /12/)

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more