view scripts/test/dirname.test @ 1393:3e8ab37a4b60 draft

Find bugfixes. The check for -print vs -print0 was tested before I optimized out the "-" in the strcmps, and I didn't adjust the offset or retest it. (Ooops.) Also, I wasn't clearing the ! value when descending into parentheticals, so "find . -name blah -o \! \( -stuff -o -thing \)" acted like it had a spurious second ! before -stuff inside the parentheses.
author Rob Landley <rob@landley.net>
date Fri, 18 Jul 2014 18:31:41 -0500
parents 786841fdb1e0
children
line wrap: on
line source

#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testing "name" "command" "result" "infile" "stdin"

testing "dirname /-only" "dirname ///////" "/\n" "" ""
testing "dirname trailing /" "dirname a//////" ".\n" "" ""
testing "dirname combined" "dirname /////a///b///c///d/////" "/////a///b///c\n" "" ""
testing "dirname /a/" "dirname /////a///" "/\n" "" ""