-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodifications_test.go
More file actions
39 lines (36 loc) · 2.86 KB
/
modifications_test.go
File metadata and controls
39 lines (36 loc) · 2.86 KB
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
package main
import (
"testing"
)
func TestHandleAllModifications(t *testing.T) {
tests := []struct {
input string
expectedOutput string
}{
{"1E (hex) files were added", "30 files were added"},
{"It has been 10 (bin) years", "It has been 2 years"},
{"Ready, set, go (up) !", "Ready, set, GO!"},
{"I should stop SHOUTING (low)", "I should stop shouting"},
{"Welcome to the Brooklyn bridge (cap)", "Welcome to the Brooklyn Bridge"},
{"This is so exciting (up, 2)", "This is SO EXCITING"},
{"I was sitting over there ,and then BAMM !!", "I was sitting over there, and then BAMM!!"},
{"I was thinking ... You were right", "I was thinking... You were right"},
{"I am exactly how they describe me: ' awesome '", "I am exactly how they describe me: 'awesome'"},
{"As Elton John said: ' I am the most well-known homosexual in the world '", "As Elton John said: 'I am the most well-known homosexual in the world'"},
{"There it was. A amazing rock!", "There it was. An amazing rock!"},
{"it (cap) was the best of times, it was the worst of times (up) , it was the age of wisdom, it was the age of foolishness (cap, 6) , it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of darkness, it was the spring of hope, IT WAS THE (low, 3) winter of despair.", "It was the best of times, it was the worst of TIMES, it was the age of wisdom, It Was The Age Of Foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of darkness, it was the spring of hope, it was the winter of despair."},
{"Simply add 42 (hex) and 10 (bin) and you will see the result is 68.", "Simply add 66 and 2 and you will see the result is 68."},
{"There is no greater agony than bearing a untold story inside you.", "There is no greater agony than bearing an untold story inside you."},
{"Punctuation tests are ... kinda boring ,what do you think ?", "Punctuation tests are... kinda boring, what do you think?"},
{"If I make you BREAKFAST IN BED (low, 3) just say thank you instead of: how (cap) did you get in my house (up, 2) ?", "If I make you breakfast in bed just say thank you instead of: How did you get in MY HOUSE?"},
{"I have to pack 101 (bin) outfits. Packed 1a (hex) just to be sure", "I have to pack 5 outfits. Packed 26 just to be sure"},
{"Don not be sad ,because sad backwards is das . And das not good", "Don not be sad, because sad backwards is das. And das not good"},
{"harold wilson (cap, 2) : ' I am a optimist ,but a optimist who carries a raincoat . '", "Harold Wilson: 'I am an optimist, but an optimist who carries a raincoat.'"},
}
for _, tt := range tests {
givenOutput := handleAllModifications(tt.input)
if givenOutput != tt.expectedOutput {
t.Errorf("handleAllModifications(%s):\n expected: %s,\n got: %s", tt.input, tt.expectedOutput, givenOutput)
}
}
}