mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 19:56:17 +00:00
Merge pull request #3133 from sylvestre/issue-3132
expr: Use chars().count() as we can have some multibytes chars
This commit is contained in:
commit
351a56d3fd
2 changed files with 27 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
// spell-checker:ignore αbcdef
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
#[test]
|
||||
|
@ -95,6 +97,27 @@ fn test_and() {
|
|||
new_ucmd!().args(&["", "&", "1"]).run().stdout_is("0\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_length_fail() {
|
||||
new_ucmd!().args(&["length", "αbcdef", "1"]).fails();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_length() {
|
||||
new_ucmd!()
|
||||
.args(&["length", "abcdef"])
|
||||
.succeeds()
|
||||
.stdout_only("6\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_length_mb() {
|
||||
new_ucmd!()
|
||||
.args(&["length", "αbcdef"])
|
||||
.succeeds()
|
||||
.stdout_only("6\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_substr() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue