-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathtask_test.go
59 lines (54 loc) · 1.5 KB
/
task_test.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"fmt"
"testing"
)
type task struct {
Str1, Str2 string
Result string
}
func TestTask(t *testing.T) {
var taskItems = generateTask()
for i := 0; i < len(taskItems); i++ {
t.Run(fmt.Sprintf("Test %d", i+1), func(t *testing.T) {
res := solution(taskItems[i].Str1, taskItems[i].Str2)
if res != taskItems[i].Result {
t.Errorf("Неверный ответ решения!\nОтвет: %s \nВерно: %s", res, taskItems[i].Result)
}
})
}
}
func generateTask() []task {
return []task{
{
Str1: "abcp",
Str2: "ahpc",
Result: "False",
},
{
Str1: "abc",
Str2: "ahbgdcu",
Result: "True",
},
{
Str1: "islx",
Str2: "yoytgtshldmogkdburkbcfvoapepjpcuwemusfkfztrzxstytrnarlizjhuoscuzlraezlaweipuuqdgvhwkhhoufexojaps",
Result: "True",
},
{
Str1: "ijha",
Str2: "hmrqvftefyixinahlzgbkidroxiptbbkjmtwpsujevkulgrjiwiwzyhngulrodiwyg",
Result: "False",
},
{
Str1: "m",
Str2: "zzkqxfdxbbjqhatygmtmpgbhumicrhtjkrfblwwnjlebsfdawznznxwyzehpubvdukmgwrivygosfkdquwxvkvtfvwjfwtvjvtplpckktmnhfnxprjetpxnddoiiqotzrjjfdwnzdjvtclcqwsvsegnuajookwppzfsf",
Result: "True",
},
{
Str1: " ",
Str2: "ggzjxvsyleybxdjtmrfdvvuiwhamerqnavroixmxkyirnktbfsyijmtqmapjwuttpwefgfdtisrmzpfalwgefvbeecbdcllvfkylplpjmqquqhmjsplpmancofucoymnbtoitltfhuolrgzlwikinojtjvhgeszkmitqgslrvmfyuxnlkzhguvfqxfbknvmxflyxuxcrgwnhbonuqjvmzmzfdapsukwqqdzpicbnhrntgdqxnajwrrgjqlncuezesuzpscjtihrfadapwslrflbtsnvismrhpjfjqvgc",
Result: "True",
},
}
}