annotate scripts/test/basename.test @ 884:ac9991f66d0d

Add firmware field to modinfo output.
author idunham@lavabit.com
date Sat, 27 Apr 2013 00:57:11 -0500
parents 786841fdb1e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
455
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
1 #!/bin/bash
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
2
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
3 [ -f testing.sh ] && . testing.sh
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
4
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
5 #testing "name" "command" "result" "infile" "stdin"
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
6
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
7 # Removal of extra /'s
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
8 testing "basename /-only" "basename ///////" "/\n" "" ""
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
9 testing "basename trailing /" "basename a//////" "a\n" "" ""
694
786841fdb1e0 Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
Rob Landley <rob@landley.net>
parents: 456
diff changeset
10 testing "basename combined" "basename /////a///b///c///d/////" "d\n" "" ""
455
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
11
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
12 # Standard suffix behavior.
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
13 testing "basename suffix" "basename a/b/c/d.suffix .suffix" "d\n" "" ""
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
14
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
15 # A suffix cannot be the entire result.
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
16 testing "basename suffix=result" "basename .txt .txt" ".txt\n" "" ""
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
17
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
18 # Deal with suffix appearing in the filename
456
dd24f86d5ad5 Minor code cleanup and typo fix.
Rob Landley <rob@landley.net>
parents: 455
diff changeset
19 testing "basename reappearing suffix 1" "basename a.txt.txt .txt" "a.txt\n" "" ""
dd24f86d5ad5 Minor code cleanup and typo fix.
Rob Landley <rob@landley.net>
parents: 455
diff changeset
20 testing "basename reappearing suffix 2" "basename a.txt.old .txt" "a.txt.old\n" "" ""
455
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
21
6c62d5b6675a Add test for basename, fix issue where suffix is wrongfully applied if it appears in the middle of the filename
Elie De Brauwer <eliedebrauwer@gmail.com>
parents:
diff changeset
22 # A suffix should be a real suffix, only a the end.
456
dd24f86d5ad5 Minor code cleanup and typo fix.
Rob Landley <rob@landley.net>
parents: 455
diff changeset
23 testing "basename invalid suffix" "basename isthisasuffix? suffix" "isthisasuffix?\n" "" ""