summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-06-26 16:09:04 +0200
committerJakob Unterwurzacher2021-06-26 16:09:04 +0200
commitcbd5e8ba01a8d35c6015f32d1e00b598bb097ffa (patch)
treeec1356ef32f84d9c527985727f4877625464414b
parent389aba6a6b91f4bbf846caeb57ffdf177fd2cfdc (diff)
tests/default: add maxlen.bash test
-rw-r--r--tests/defaults/main_test.go28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/defaults/main_test.go b/tests/defaults/main_test.go
index e7e065e..4e5ffea 100644
--- a/tests/defaults/main_test.go
+++ b/tests/defaults/main_test.go
@@ -318,9 +318,9 @@ read(3, "M:\tSylwester Nawrocki <s.nawrock"..., 32768) = 32768
read(3, "rs/scsi/eata*\n\nEATA ISA/EISA/PCI"..., 32768) = 32768
read(3, "F:\tDocumentation/isapnp.txt\nF:\td"..., 32768) = 32768
read(3, "hunkeey@googlemail.com>\nL:\tlinux"..., 32768) = 32768
-read(3, "ach-spear3xx/\n\nSPEAR6XX MACHINE "..., 32768) = 32768
+read(3, "ach-spear3xx/\n\nSPEAR6XX MACHINE "..., 32768) = 32768 <--- WRONG LENGTH!!!
read(3, "", 32768) = 0
-lseek(3, 0, SEEK_CUR) = 196608
+lseek(3, 0, SEEK_CUR) = 196608 <--- WRONG LENGTH!!!
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x2), ...}) = 0
write(1, "279b6ab0491e7532132e8f32afe6c04d"..., 56279b6ab0491e7532132e8f32afe6c04d linux-3.0/MAINTAINERS
@@ -373,3 +373,27 @@ func TestMd5sumMaintainers(t *testing.T) {
t.Logf("full output:\n%s", out)
}
}
+
+func TestMaxlen(t *testing.T) {
+ workDir := filepath.Join(test_helpers.DefaultPlainDir, t.Name())
+ if err := os.Mkdir(workDir, 0700); err != nil {
+ t.Fatal(err)
+ }
+ cmd := exec.Command("../../contrib/maxlen.bash", workDir)
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Log(string(out))
+ t.Fatal(err)
+ }
+ want := `
+ Maximum filename length: 255
+ Maximum dirname length: 255
+ Maximum path length with 1 chars per subdir: 4095
+ Maximum path length with 10 chars per subdir: 4095
+ Maximum path length with 100 chars per subdir: 4095
+ Maximum path length with 255 chars per subdir: 4095
+`
+ if !strings.HasSuffix(string(out), want) {
+ t.Errorf("wrong output: %s", string(out))
+ }
+}