mirror of
https://github.com/pikami/tiktok-dl.git
synced 2025-12-22 02:09:50 +00:00
Added more unit tests
This commit is contained in:
15
unitTestUtil/assert.go
Normal file
15
unitTestUtil/assert.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package unittestutil
|
||||
|
||||
// AssertString - Check if two strings match
|
||||
func (tu *TestUtil) AssertString(actual string, expected string, name string) {
|
||||
if actual != expected {
|
||||
tu.T.Errorf("%s is incorrect: Expected '%s', but got '%s'", name, expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
// AssertInt - Check if two intagers match
|
||||
func (tu *TestUtil) AssertInt(actual int, expected int, name string) {
|
||||
if actual != expected {
|
||||
tu.T.Errorf("%s is incorrect: Expected '%d', but got '%d'", name, expected, actual)
|
||||
}
|
||||
}
|
||||
10
unitTestUtil/unitTestUtil.go
Normal file
10
unitTestUtil/unitTestUtil.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package unittestutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestUtil - Utility for testing
|
||||
type TestUtil struct {
|
||||
T *testing.T
|
||||
}
|
||||
Reference in New Issue
Block a user