Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
0bac32b7
Commit
0bac32b7
authored
Jan 14, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add escape test for PluginOptions
parent
03a6b079
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt
...t/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt
+16
-1
No files found.
plugin/src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt
View file @
0bac32b7
...
@@ -25,7 +25,7 @@ import org.junit.Test
...
@@ -25,7 +25,7 @@ import org.junit.Test
class
PluginOptionsTest
{
class
PluginOptionsTest
{
@Test
@Test
fun
equal
()
{
fun
basic
()
{
val
o1
=
PluginOptions
(
"obfs-local;obfs=http;obfs-host=localhost"
)
val
o1
=
PluginOptions
(
"obfs-local;obfs=http;obfs-host=localhost"
)
val
o2
=
PluginOptions
(
"obfs-local"
,
"obfs-host=localhost;obfs=http"
)
val
o2
=
PluginOptions
(
"obfs-local"
,
"obfs-host=localhost;obfs=http"
)
Assert
.
assertEquals
(
o1
.
hashCode
(),
o2
.
hashCode
())
Assert
.
assertEquals
(
o1
.
hashCode
(),
o2
.
hashCode
())
...
@@ -35,4 +35,19 @@ class PluginOptionsTest {
...
@@ -35,4 +35,19 @@ class PluginOptionsTest {
val
o4
=
PluginOptions
(
o2
.
id
,
o2
.
toString
())
val
o4
=
PluginOptions
(
o2
.
id
,
o2
.
toString
())
Assert
.
assertEquals
(
true
,
o3
==
o4
)
Assert
.
assertEquals
(
true
,
o3
==
o4
)
}
}
@Test
fun
escape
()
{
val
options
=
PluginOptions
(
"escapeTest"
)
options
[
"subject"
]
=
"value;semicolon"
Assert
.
assertEquals
(
true
,
options
==
PluginOptions
(
options
.
toString
(
false
)))
options
[
"key;semicolon"
]
=
"object"
Assert
.
assertEquals
(
true
,
options
==
PluginOptions
(
options
.
toString
(
false
)))
options
[
"subject"
]
=
"value=equals"
Assert
.
assertEquals
(
true
,
options
==
PluginOptions
(
options
.
toString
(
false
)))
options
[
"key=equals"
]
=
"object"
Assert
.
assertEquals
(
true
,
options
==
PluginOptions
(
options
.
toString
(
false
)))
options
[
"advanced\\=;test"
]
=
"in;=\\progress"
Assert
.
assertEquals
(
true
,
options
==
PluginOptions
(
options
.
toString
(
false
)))
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment