1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #7521 from usamoi/ptx

ptx: fixes
This commit is contained in:
Sylvestre Ledru 2025-03-23 09:28:20 +01:00 committed by GitHub
commit 8931d2c26e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 157 additions and 55 deletions

View file

@ -2,6 +2,7 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore roff
use crate::common::util::TestScenario;
#[test]
@ -112,3 +113,50 @@ fn gnu_ext_disabled_empty_word_regexp_ignores_break_file() {
.succeeds()
.stdout_only_fixture("gnu_ext_disabled_rightward_no_ref.expected");
}
#[test]
fn test_reject_too_many_operands() {
new_ucmd!().args(&["-G", "-", "-", "-"]).fails_with_code(1);
}
#[test]
fn test_break_file_regex_escaping() {
new_ucmd!()
.pipe_in("\\.+*?()|[]{}^$#&-~")
.args(&["-G", "-b", "-", "input"])
.succeeds()
.stdout_only_fixture("break_file_regex_escaping.expected");
}
#[test]
fn test_ignore_case() {
new_ucmd!()
.args(&["-G", "-f"])
.pipe_in("a _")
.succeeds()
.stdout_only(".xx \"\" \"\" \"a _\" \"\"\n.xx \"\" \"a\" \"_\" \"\"\n");
}
#[test]
fn test_format() {
new_ucmd!()
.args(&["-G", "-O"])
.pipe_in("a")
.succeeds()
.stdout_only(".xx \"\" \"\" \"a\" \"\"\n");
new_ucmd!()
.args(&["-G", "-T"])
.pipe_in("a")
.succeeds()
.stdout_only("\\xx {}{}{a}{}{}\n");
new_ucmd!()
.args(&["-G", "--format=roff"])
.pipe_in("a")
.succeeds()
.stdout_only(".xx \"\" \"\" \"a\" \"\"\n");
new_ucmd!()
.args(&["-G", "--format=tex"])
.pipe_in("a")
.succeeds()
.stdout_only("\\xx {}{}{a}{}{}\n");
}