Skip to content

Commit cc5ed5e

Browse files
0xPoeTurbo87
authored andcommitted
Add unicode feature name test case
Signed-off-by: hi-rustin <[email protected]>
1 parent 9d2a331 commit cc5ed5e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/tests/krate/publish/features.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ fn feature_name_start_with_number_and_underscore() {
4545
assert_json_snapshot!(crates);
4646
}
4747

48+
#[test]
49+
fn feature_name_with_unicode_chars() {
50+
let (app, _, _, token) = TestApp::full().with_token();
51+
let crate_to_publish = PublishBuilder::new("foo", "1.0.0").feature("foo.你好世界", &[]);
52+
token.publish_crate(crate_to_publish).good();
53+
let crates = app.crates_from_index_head("foo");
54+
assert_json_snapshot!(crates);
55+
}
56+
4857
#[test]
4958
fn empty_feature_name() {
5059
let (app, _, _, token) = TestApp::full().with_token();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
source: src/tests/krate/publish/features.rs
3+
expression: crates
4+
---
5+
[
6+
{
7+
"name": "foo",
8+
"vers": "1.0.0",
9+
"deps": [],
10+
"cksum": "493720846371607438c1a4eb90c9cc7d7286600ca9c4e2ca04151aad9563b47a",
11+
"features": {
12+
"foo.你好世界": []
13+
},
14+
"yanked": false
15+
}
16+
]

0 commit comments

Comments
 (0)