forked from extern/nushell
fix interpolated strings when using unicode (#3866)
* fix interpolated strings when using unicode * added test case
This commit is contained in:
parent
23ba01d89c
commit
1e15f26e98
@ -650,7 +650,7 @@ fn parse_interpolated_string(
|
||||
scope: &dyn ParserScope,
|
||||
) -> (SpannedExpression, Option<ParseError>) {
|
||||
trace!("Parse_interpolated_string");
|
||||
let string_len = lite_arg.item.len();
|
||||
let string_len = lite_arg.item.chars().count();
|
||||
let inner_string = lite_arg
|
||||
.item
|
||||
.chars()
|
||||
|
@ -215,6 +215,19 @@ fn string_interpolation_and_paren() {
|
||||
assert_eq!(actual.out, "a paren is (");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn string_interpolation_with_unicode() {
|
||||
//カ = U+30AB : KATAKANA LETTER KA
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
$"カ"
|
||||
"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "カ");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bignum_large_integer() {
|
||||
let actual = nu!(
|
||||
|
Loading…
Reference in New Issue
Block a user