mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
test/expr: add regex tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// spell-checker:ignore αbcdef
|
||||
// spell-checker:ignore αbcdef ; (people) kkos
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
@@ -179,6 +179,27 @@ fn test_length_mb() {
|
||||
.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]
|
||||
fn test_substr() {
|
||||
new_ucmd!()
|
||||
|
||||
Reference in New Issue
Block a user