forked from json-iterator/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestInt.java
More file actions
34 lines (26 loc) · 931 Bytes
/
TestInt.java
File metadata and controls
34 lines (26 loc) · 931 Bytes
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
package com.jsoniter;
import com.jsoniter.Jsoniter;
import junit.framework.TestCase;
import java.io.IOException;
public class TestInt extends TestCase {
public void test_unsigned_int() throws IOException {
Jsoniter iter = Jsoniter.parse("123");
assertEquals(123, iter.readUnsignedInt());
}
public void test_int() throws IOException {
Jsoniter iter = Jsoniter.parse("-123");
assertEquals(-123, iter.readInt());
}
public void test_short() throws IOException {
Jsoniter iter = Jsoniter.parse("-123");
assertEquals(-123, iter.readShort());
}
public void test_unsigned_long() throws IOException {
Jsoniter iter = Jsoniter.parse("123");
assertEquals(123, iter.readUnsignedLong());
}
public void test_long() throws IOException {
Jsoniter iter = Jsoniter.parse("-123");
assertEquals(-123, iter.readLong());
}
}