Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos-rs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
deft
Neos-rs
Commits
fdfed1f7
Commit
fdfed1f7
authored
Dec 22, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test_strings_conf_reader
parent
84ee3188
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
src/service/strings.rs
src/service/strings.rs
+31
-0
No files found.
src/service/strings.rs
View file @
fdfed1f7
...
@@ -51,3 +51,34 @@ fn parse_code(code: &str) -> anyhow::Result<i64> {
...
@@ -51,3 +51,34 @@ fn parse_code(code: &str) -> anyhow::Result<i64> {
Ok
(
code
.parse
()
?
)
Ok
(
code
.parse
()
?
)
}
}
}
}
#[cfg(test)]
mod
tests
{
use
super
::
strings_conf_reader
;
#[test]
fn
test_strings_conf_reader
()
{
let
workspace
=
env!
(
"CARGO_MANIFEST_DIR"
);
let
strings_manager
=
strings_conf_reader
(
format!
(
"{workspace}/ygopro-database/locales/zh-CN/strings.conf"
))
.unwrap_or_default
();
assert_eq!
(
strings_manager
.get
(
"!system"
)
.unwrap
()
.get
(
&
100
)
.unwrap
(),
"先攻"
);
assert_eq!
(
strings_manager
.get
(
"!counter"
)
.unwrap
()
.get
(
&
0x56
)
.unwrap
(),
"炎星指示物"
);
assert_eq!
(
strings_manager
.get
(
"!setname"
)
.unwrap
()
.get
(
&
0x3008
)
.unwrap
(),
"元素英雄 E・HERO"
);
}
}
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