mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
test/expr: add regex tests
This commit is contained in:
parent
8753fb95c3
commit
737271de96
1 changed files with 22 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
// spell-checker:ignore αbcdef
|
// spell-checker:ignore αbcdef ; (people) kkos
|
||||||
|
|
||||||
use crate::common::util::*;
|
use crate::common::util::*;
|
||||||
|
|
||||||
|
@ -179,6 +179,27 @@ fn test_length_mb() {
|
||||||
.stdout_only("6\n");
|
.stdout_only("6\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_regex() {
|
||||||
|
// FixME: [2022-12-19; rivy] test disabled as it currently fails due to 'oniguruma' bug (see GH:kkos/oniguruma/issues/279)
|
||||||
|
// new_ucmd!()
|
||||||
|
// .args(&["a^b", ":", "a^b"])
|
||||||
|
// .succeeds()
|
||||||
|
// .stdout_only("3\n");
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["a^b", ":", "a\\^b"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only("3\n");
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["a$b", ":", "a\\$b"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only("3\n");
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["-5", ":", "-\\{0,1\\}[0-9]*$"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only("2\n");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_substr() {
|
fn test_substr() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue