Add sync command
This commit is contained in:
commit
5e6a5e23fd
18 changed files with 1077 additions and 0 deletions
36
app/utils_test.go
Normal file
36
app/utils_test.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package app
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestGetFileExtension(t *testing.T) {
|
||||
|
||||
toTest := map[string]string{
|
||||
"myYamlFile.yaml": "yaml",
|
||||
"myTxtFile.txt": "txt",
|
||||
"myJsonFile.json": "json",
|
||||
}
|
||||
|
||||
for key, value := range toTest {
|
||||
result, err := getFileExcension(key)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
if result != value {
|
||||
t.Errorf("Expected to get %v, instead of this got %v", value, result)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestErrorInGetExcensionFile(t *testing.T) {
|
||||
|
||||
result, err := getFileExcension("test")
|
||||
|
||||
if err == nil {
|
||||
t.Errorf("Expected to get error, instead of this got result %v", result)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue