testing.assertEmpty() function tests if an input stream is empty.
If not empty, the function returns an error.
Function type: Test
import "testing" testing.assertEmpty()
testing.assertEmpty() function can be used to perform in-line tests in a query.
Check if there is a difference between streams
This example uses the
which outputs the diff for the two streams.
.testing.assertEmpty() function checks to see if the diff is empty.
import "testing" got = from(bucket: "example-bucket") |> range(start: -15m) want = from(bucket: "backup_example-bucket") |> range(start: -15m) got |> testing.diff(want: want) |> testing.assertEmpty()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support or submit feedback, the following resources are available:
- Post in the InfluxData Community.
- Submit documentation issues to the InfluxDB 2.0 documentation repository.
- Submit InfluxDB issues to the InfluxDB repository.
For our InfluxDB Cloud customers, InfluxData Support is also available.