Skip to content

Commit

Permalink
Add unicode feature name test case
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 authored and Turbo87 committed Nov 15, 2023
1 parent 9d2a331 commit cc5ed5e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tests/krate/publish/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ fn feature_name_start_with_number_and_underscore() {
assert_json_snapshot!(crates);
}

#[test]
fn feature_name_with_unicode_chars() {
let (app, _, _, token) = TestApp::full().with_token();
let crate_to_publish = PublishBuilder::new("foo", "1.0.0").feature("foo.你好世界", &[]);
token.publish_crate(crate_to_publish).good();
let crates = app.crates_from_index_head("foo");
assert_json_snapshot!(crates);
}

#[test]
fn empty_feature_name() {
let (app, _, _, token) = TestApp::full().with_token();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: src/tests/krate/publish/features.rs
expression: crates
---
[
{
"name": "foo",
"vers": "1.0.0",
"deps": [],
"cksum": "493720846371607438c1a4eb90c9cc7d7286600ca9c4e2ca04151aad9563b47a",
"features": {
"foo.你好世界": []
},
"yanked": false
}
]

0 comments on commit cc5ed5e

Please sign in to comment.