MCPcopy Create free account
hub / github.com/google/gapid / ExampleFloat

Function ExampleFloat

core/assert/float_test.go:20–33  ·  view source on GitHub ↗

An example of testing float values

()

Source from the content-addressed store, hash-verified

18
19// An example of testing float values
20func ExampleFloat() {
21 assert := assert.To(nil)
22 assert.For("1.1 IsAtLeast 2.1").ThatFloat(1.1).IsAtLeast(2.1)
23 assert.For("3.1 IsAtMost 4.1").ThatFloat(3.1).IsAtMost(4.1)
24 assert.For("6.1 IsAtLeast 5.1").ThatFloat(6.1).IsAtLeast(5.1)
25 assert.For("8.1 IsAtMost 7.1").ThatFloat(8.1).IsAtMost(7.1)
26 // Output:
27 // Error:1.1 IsAtLeast 2.1
28 // Got 1.1
29 // Expect >= 2.1
30 // Error:8.1 IsAtMost 7.1
31 // Got 8.1
32 // Expect <= 7.1
33}

Callers

nothing calls this directly

Calls 4

ThatFloatMethod · 0.80
ForMethod · 0.80
IsAtLeastMethod · 0.45
IsAtMostMethod · 0.45

Tested by

no test coverage detected