FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java/src/test/java/com/jsoniter/TestSlice.java at master · ws-php/java · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ws-php
/
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
/
TestSlice.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (29 loc) · 1.01 KB
Breadcrumbs
java
/
src
/
test
/
java
/
com
/
jsoniter
/
TestSlice.java
Copy path
File metadata and controls
35 lines (29 loc) · 1.01 KB
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
29
30
31
32
33
34
35
package
com
.
jsoniter
;
import
junit
.
framework
.
TestCase
;
import
org
.
junit
.
Assert
;
public
class
TestSlice
extends
TestCase
{
public
void
test_append
() {
Slice
slice
=
Slice
.
make
(
0
,
1
);
slice
.
append
((
byte
)
1
);
Assert
.
assertArrayEquals
(
new
byte
[]{
1
},
slice
.
data
);
slice
.
append
((
byte
)
2
);
Assert
.
assertArrayEquals
(
new
byte
[]{
1
,
2
},
slice
.
data
);
}
public
void
test_hash_code
() {
Slice
slice1
=
Slice
.
make
(
0
,
1
);
slice1
.
append
((
byte
)
1
);
Slice
slice2
=
Slice
.
make
(
0
,
1
);
slice2
.
append
((
byte
)
1
);
assertEquals
(
slice1
,
slice2
);
assertEquals
(
slice1
.
hashCode
(),
slice2
.
hashCode
());
}
public
void
test_equals
() {
assertTrue
(
Slice
.
make
(
"hello"
).
equals
(
Slice
.
make
(
"hello"
)));
assertTrue
(
Slice
.
make
(
"hello"
).
equals
(
new
Slice
(
"ahello"
.
getBytes
(),
1
,
5
)));
}
public
void
test_to_string
() {
Slice
slice
=
Slice
.
make
(
0
,
2
);
slice
.
append
((
byte
)
'a'
);
assertEquals
(
"a"
,
slice
.
toString
());
}
}
Back
|
FazBrowse Home
|
New Git URL