Skip to content

Commit 98d8bd8

Browse files
committed
Improve unit test for the setInterval().
1 parent db5f33d commit 98d8bd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/com/github/underscore/FunctionsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.junit.Test;
2828
import static java.util.Arrays.asList;
2929
import static org.junit.Assert.assertEquals;
30+
import static org.junit.Assert.assertTrue;
3031

3132
/**
3233
* Underscore library unit test.
@@ -317,7 +318,7 @@ public void setInterval() throws Exception {
317318
counter[0]++; return null; } };
318319
$.setInterval(incr, 10);
319320
Thread.sleep(45);
320-
assertEquals(4, counter[0].intValue());
321+
assertTrue(counter[0].intValue() == 4 || counter[0].intValue() == 5);
321322
}
322323

323324
@Test

0 commit comments

Comments
 (0)