TestNeverTrue checks Never with a condition that returns true on second call.
(t *testing.T)
| 2854 | |
| 2855 | // TestNeverTrue checks Never with a condition that returns true on second call. |
| 2856 | func 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) |