blob: c6e5c87efb26fcd9dc0ba54e99e5e69c21ddc1c4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.result;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Integrity test for representation of undefined numeric field values.
*
* @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
*/
public class NanNumberTestCase {
@Test
public final void testIntValue() {
assertEquals(0, NanNumber.NaN.intValue());
}
@Test
public final void testLongValue() {
assertEquals(0L, NanNumber.NaN.longValue());
}
@Test
public final void testFloatValue() {
assertTrue(Float.isNaN(NanNumber.NaN.floatValue()));
}
@Test
public final void testDoubleValue() {
assertTrue(Double.isNaN(NanNumber.NaN.doubleValue()));
}
@Test
public final void testToString() {
assertEquals("", NanNumber.NaN.toString());
}
}
|