Skip to content

Commit 249ec92

Browse files
committed
Add unicode feature name test case
Signed-off-by: hi-rustin <[email protected]>
1 parent 9f81356 commit 249ec92

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
@@ -44,6 +44,15 @@ fn feature_name_start_with_number_and_underscore() {
4444
assert_json_snapshot!(crates);
4545
}
4646

47+
#[test]
48+
fn feature_name_with_unicode_chars() {
49+
let (app, _, _, token) = TestApp::full().with_token();
50+
let crate_to_publish = PublishBuilder::new("foo", "1.0.0").feature("foo.你好世界", &[]);
51+
token.publish_crate(crate_to_publish).good();
52+
let crates = app.crates_from_index_head("foo");
53+
assert_json_snapshot!(crates);
54+
}
55+
4756
#[test]
4857
fn empty_feature_name() {
4958
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)