From 1bfcc8b08e511be7228f93079f669d95392ef184 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Mar 2009 04:50:18 +0000 Subject: tr: support [:xdigit:], fix handling of ranges and [x]'s. add testsuite entry for each of 3 bugs fixed. function old new delta static.classes 73 82 +9 expand 1738 1743 +5 complement 74 72 -2 tr_main 472 463 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 14/-11) Total: 3 bytes --- testsuite/tr.tests | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 testsuite/tr.tests (limited to 'testsuite/tr.tests') diff --git a/testsuite/tr.tests b/testsuite/tr.tests new file mode 100644 index 000000000..7339ccff2 --- /dev/null +++ b/testsuite/tr.tests @@ -0,0 +1,22 @@ +#!/bin/sh + +# Copyright 2009 by Denys Vlasenko +# Licensed under GPL v2, see file LICENSE for details. + +. testing.sh + +# testing "description" "arguments" "result" "infile" "stdin" + +testing "tr does not treat [] in [a-z] as special" \ + "tr '[q-z]' '_Q-Z+'" \ + "_QWe+" "" "[qwe]" + +testing "tr understands 0-9A-F" \ + "tr -cd '[0-9A-F]'" \ + "19AF" "" "19AFH\n" + +testing "tr understands [:xdigit:]" \ + "tr -cd '[:xdigit:]'" \ + "19AF" "" "19AFH\n" + +exit $FAILCOUNT -- cgit v1.2.3