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!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.