mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
COCOS-159 - Improve test coverage to 65% (#310)
* few atls tests Signed-off-by: Sammy Oina <sammyoina@gmail.com> * remove commented code Signed-off-by: Sammy Oina <sammyoina@gmail.com> * add atls tests Signed-off-by: Sammy Oina <sammyoina@gmail.com> * new line Signed-off-by: Sammy Oina <sammyoina@gmail.com> * add more test cases Signed-off-by: Sammy Oina <sammyoina@gmail.com> * more test cases Signed-off-by: Sammy Oina <sammyoina@gmail.com> * add empty line and parallel test cases Signed-off-by: Sammy Oina <sammyoina@gmail.com> * move const outside test case Signed-off-by: Sammy Oina <sammyoina@gmail.com> --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d5941edb56
commit
5a22ac2eca
@@ -38,6 +38,13 @@ func TestCopyFile(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCopyFile_NonExistentSource(t *testing.T) {
|
||||
err := CopyFile("nonexistent.txt", "destination.txt")
|
||||
if err == nil {
|
||||
t.Error("CopyFile did not return an error for a nonexistent source file")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteFilesInDir(t *testing.T) {
|
||||
tempDir, err := os.MkdirTemp("", "deletefiles_test")
|
||||
if err != nil {
|
||||
@@ -111,6 +118,13 @@ func TestChecksum(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestChecksum_NonExistentFile(t *testing.T) {
|
||||
_, err := Checksum("nonexistent.txt")
|
||||
if err == nil {
|
||||
t.Error("Checksum did not return an error for a nonexistent file")
|
||||
}
|
||||
}
|
||||
|
||||
func TestChecksumHex(t *testing.T) {
|
||||
tempFile, err := os.CreateTemp("", "checksumhex_test")
|
||||
if err != nil {
|
||||
@@ -134,3 +148,10 @@ func TestChecksumHex(t *testing.T) {
|
||||
t.Errorf("ChecksumHex mismatch. Got %s, want %s", checksumHex, expectedChecksumHex)
|
||||
}
|
||||
}
|
||||
|
||||
func TestChecksumHex_NonExistentFile(t *testing.T) {
|
||||
_, err := ChecksumHex("nonexistent.txt")
|
||||
if err == nil {
|
||||
t.Error("ChecksumHex did not return an error for a nonexistent file")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user