Neha
Neha

Reputation: 805

how can I write a test case to compare infinity value?

how can I write a test case to compare infinity value. Example 10/0.0 results infinity how can i write following for it

assertThat(<**what will be here?**>).isCloseTo(10/0.0);

Upvotes: 3

Views: 265

Answers (1)

xingbin
xingbin

Reputation: 28279

How about

assertTrue(Double.isInfinite(10/0.0))

Upvotes: 5

Related Questions