MCPcopy Create free account
hub / github.com/expr-lang/expr / TestNeverTrue

Function TestNeverTrue

internal/testify/assert/assertions_test.go:2856–2872  ·  view source on GitHub ↗

TestNeverTrue checks Never with a condition that returns true on second call.

(t *testing.T)

Source from the content-addressed store, hash-verified

2854
2855// TestNeverTrue checks Never with a condition that returns true on second call.
2856func TestNeverTrue(t *testing.T) {
2857 mockT := new(testing.T)
2858
2859 // A list of values returned by condition.
2860 // Channel protects against concurrent access.
2861 returns := make(chan bool, 2)
2862 returns <- false
2863 returns <- true
2864 defer close(returns)
2865
2866 // Will return true on second call.
2867 condition := func() bool {
2868 return <-returns
2869 }
2870
2871 False(t, Never(mockT, condition, 100*time.Millisecond, 20*time.Millisecond))
2872}
2873
2874// Check that a long running condition doesn't block Eventually.
2875// See issue 805 (and its long tail of following issues)

Callers

nothing calls this directly

Calls 2

FalseFunction · 0.70
NeverFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…