From 09a17df1bc9ddc87923fa0453c84e3d28647db94 Mon Sep 17 00:00:00 2001 From: "Ian A. Mason" Date: Wed, 7 Sep 2022 14:42:53 -0700 Subject: [PATCH] put gocyclo out of it's misery. --- tests/entry_test.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/entry_test.go b/tests/entry_test.go index 0abd9c3..5d10123 100644 --- a/tests/entry_test.go +++ b/tests/entry_test.go @@ -150,6 +150,9 @@ func Test_file_type(t *testing.T) { fmt.Printf("GetBinaryType(%v) = %v\n", exeFile, binaryFileType) } + PlainFile(t, fictionalFile, dataDir, sourceFile, objectFile, exeFile) + + /* var plain bool plain = shared.IsPlainFile(fictionalFile) @@ -186,5 +189,45 @@ func Test_file_type(t *testing.T) { } else if DEBUG { fmt.Printf("shared.IsPlainFile(%v) returned %v\n", exeFile, plain) } + */ } + +func PlainFile(t *testing.T, fictionalFile string, dataDir string, sourceFile string, objectFile string, exeFile string) { + var plain bool + plain = shared.IsPlainFile(fictionalFile) + + if plain { + t.Errorf("shared.IsPlainFile(%v) returned %v\n", fictionalFile, plain) + } else if DEBUG { + fmt.Printf("shared.IsPlainFile(%v) returned %v\n", fictionalFile, plain) + } + + plain = shared.IsPlainFile(dataDir) + if plain { + t.Errorf("shared.IsPlainFile(%v) returned %v\n", dataDir, plain) + } else if DEBUG { + fmt.Printf("shared.IsPlainFile(%v) returned %v\n", dataDir, plain) + } + + plain = shared.IsPlainFile(sourceFile) + if !plain { + t.Errorf("shared.IsPlainFile(%v) returned %v\n", sourceFile, plain) + } else if DEBUG { + fmt.Printf("shared.IsPlainFile(%v) returned %v\n", sourceFile, plain) + } + + plain = shared.IsPlainFile(objectFile) + if !plain { + t.Errorf("shared.IsPlainFile(%v) returned %v\n", objectFile, plain) + } else if DEBUG { + fmt.Printf("shared.IsPlainFile(%v) returned %v\n", objectFile, plain) + } + + plain = shared.IsPlainFile(exeFile) + if !plain { + t.Errorf("shared.IsPlainFile(%v) returned %v\n", exeFile, plain) + } else if DEBUG { + fmt.Printf("shared.IsPlainFile(%v) returned %v\n", exeFile, plain) + } +}