xref: /aosp_15_r20/external/toybox/tests/dirname.test (revision cf5a6c84e2b8763fc1a7db14496fd4742913b199)
1*cf5a6c84SAndroid Build Coastguard Worker#!/bin/bash
2*cf5a6c84SAndroid Build Coastguard Worker
3*cf5a6c84SAndroid Build Coastguard Worker[ -f testing.sh ] && . testing.sh
4*cf5a6c84SAndroid Build Coastguard Worker
5*cf5a6c84SAndroid Build Coastguard Worker#testing "name" "command" "result" "infile" "stdin"
6*cf5a6c84SAndroid Build Coastguard Worker
7*cf5a6c84SAndroid Build Coastguard Workertesting "/-only" "dirname ///////" "/\n" "" ""
8*cf5a6c84SAndroid Build Coastguard Workertesting "trailing /" "dirname a//////" ".\n" "" ""
9*cf5a6c84SAndroid Build Coastguard Workertesting "combined" "dirname /////a///b///c///d/////" "/////a///b///c\n" "" ""
10*cf5a6c84SAndroid Build Coastguard Workertesting "/a/" "dirname /////a///" "/\n" "" ""
11*cf5a6c84SAndroid Build Coastguard Workertesting "multiple" "dirname hello/a world/b" "hello\nworld\n" "" ""
12