FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java/src/test/java/com/jsoniter/TestBoolean.java at master · rubythonode/java · GitHub
rubythonode
/
java
Public
forked from
json-iterator/java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java
/
src
/
test
/
java
/
com
/
jsoniter
/
TestBoolean.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (24 loc) · 989 Bytes
Breadcrumbs
java
/
src
/
test
/
java
/
com
/
jsoniter
/
TestBoolean.java
Copy path
File metadata and controls
28 lines (24 loc) · 989 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
com
.
jsoniter
;
import
junit
.
framework
.
TestCase
;
import
java
.
io
.
ByteArrayInputStream
;
import
java
.
io
.
IOException
;
public
class
TestBoolean
extends
TestCase
{
@
org
.
junit
.
experimental
.
categories
.
Category
(
StreamingCategory
.
class
)
public
void
test_streaming
()
throws
IOException
{
JsonIterator
iter
=
JsonIterator
.
parse
(
new
ByteArrayInputStream
(
"[true,false,null,true]"
.
getBytes
()),
3
);
iter
.
readArray
();
assertTrue
(
iter
.
readBoolean
());
iter
.
readArray
();
assertFalse
(
iter
.
readBoolean
());
iter
.
readArray
();
assertTrue
(
iter
.
readNull
());
iter
.
readArray
();
assertTrue
(
iter
.
readBoolean
());
}
public
void
test_non_streaming
()
throws
IOException
{
assertTrue
(
JsonIterator
.
parse
(
"true"
).
readBoolean
());
assertFalse
(
JsonIterator
.
parse
(
"false"
).
readBoolean
());
assertTrue
(
JsonIterator
.
parse
(
"null"
).
readNull
());
assertFalse
(
JsonIterator
.
parse
(
"false"
).
readNull
());
}
}
Back
|
FazBrowse Home
|
New Git URL