-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_test.go
More file actions
33 lines (25 loc) · 798 Bytes
/
main_test.go
File metadata and controls
33 lines (25 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import "testing"
func Test_getLanguage(t *testing.T) {
t.Run("should return 'German' for German File", func(t *testing.T) {
lang := getLanguage("German Word Frequency toBe Translated - Sheet1.csv")
if lang != "German" {
t.Error("Did not return the correct language")
}
})
t.Run("should return 'French' for French File", func(t *testing.T) {
lang := getLanguage("French Word Frequency toBe Translated - Sheet1.csv")
if lang != "French" {
t.Error("Did not return the correct language")
}
})
}
func Test_getMergeKey(t *testing.T) {
mergeKey := getMergeKey()
if mergeKey["English"]["block"] != "block" {
t.Errorf("This is the wrong key: %v", mergeKey)
}
if mergeKey["German"]["Block"] != "block" {
t.Errorf("This is the wrong key: %v", mergeKey)
}
}