Skip to content

Commit

Permalink
put gocyclo out of it's misery.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianamason committed Sep 7, 2022
1 parent ede7a49 commit 09a17df
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 09a17df

Please sign in to comment.