Hello,

Attached are three small tests for uniq with "--ignore-case" (they pass, the 
option was simply not tested before).

Also,
I noticed that by running the default test suite ("make check SUBDIRS=."), the 
majority of uniq tests are skipped:
  uniq: skipping this test -- no appropriate locale
  SKIP: tests/misc/uniq.pl
  PASS: tests/misc/uniq-perf.sh

This is due to tests/misc/uniq.pl line 83:
 83 # I've only ever triggered the problem in a non-C locale.                   
    
 84 my $locale = $ENV{LOCALE_FR};                                               
    
 85 ! defined $locale || $locale eq 'none'                                      
    
 86   and CuSkip::skip "$prog: skipping this test -- no appropriate locale\n";  
    

which skips the entire suite if there's no french locale defined, even though 
only one test actually sets the locale.

I can have a patch for it, if that's acceptable.

-gordon

>From c8cec42eee16f3824635a3ba93b9360b2e7b236d Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email protected]>
Date: Tue, 12 Feb 2013 10:30:25 -0500
Subject: [PATCH] tests: add '--ignore-case' tests for uniq.

* tests/misc/uniq.pl: add tests for --ignore-case.
---
 tests/misc/uniq.pl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/misc/uniq.pl b/tests/misc/uniq.pl
index 140a49b..e3873b5 100755
--- a/tests/misc/uniq.pl
+++ b/tests/misc/uniq.pl
@@ -199,6 +199,10 @@ my @Tests =
  # Check that --zero-terminated is synonymous with -z.
  ['123', '--zero-terminated', {IN=>"a\na\nb"}, {OUT=>"a\na\nb\0"}],
  ['124', '--zero-terminated', {IN=>"a\0a\0b"}, {OUT=>"a\0b\0"}],
+ # Check ignore-case
+ ['125', '',              {IN=>"A\na\n"}, {OUT=>"A\na\n"}],
+ ['126', '-i',            {IN=>"A\na\n"}, {OUT=>"A\n"}],
+ ['127', '--ignore-case', {IN=>"A\na\n"}, {OUT=>"A\n"}],
 );
 
 # Set _POSIX2_VERSION=199209 in the environment of each obs-plus* test.
-- 
1.7.7.4

Reply via email to