Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-bareikis authored Sep 14, 2023
2 parents 13ce9f3 + 3b55eeb commit f235806
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 0 deletions.
28 changes: 28 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,34 @@ func doTest(tc *testCase) func(*testing.T) {
}
}

func TestBig(t *testing.T) {
lang := os.Getenv("LANGUAGE")

team1 := "HEHE1 50 "
team2 := "HEHE2 51 "
team3 := "HEHE3 52 "

steps := strings.Repeat("1000 ", 1000000)

in := ""
in += team1 + steps + "\n"
in += team2 + steps + "\n"
in += team3 + steps + "\n"

out, err := script.Echo(in).Exec("./run-" + lang + ".sh").String()
assert.NoError(t, err)

expected := `HEHE1 1 500000.00
HEHE2 1 510000.00
HEHE3 1 520000.00`

assert.Equal(
t,
strings.TrimSpace(expected),
strings.TrimSpace(out),
)
}

func run(inFile string) (string, error) {
lang := os.Getenv("LANGUAGE")
return script.File(inFile).Exec("./run-" + lang + ".sh").String()
Expand Down
1 change: 1 addition & 0 deletions tests/bigfoot/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IAMHUGE 1 0.15
1 change: 1 addition & 0 deletions tests/bigfoot/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IAMHUGE 5023 1 1 1
2 changes: 2 additions & 0 deletions tests/emoji/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HEHE💀☠️ 1 3.50
FIRE🔥🔥🔥🔥 1 5.00
2 changes: 2 additions & 0 deletions tests/emoji/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HEHE💀☠️ 100 1500 2000
FIRE🔥🔥🔥🔥 100 2000 3000
2 changes: 2 additions & 0 deletions tests/hehe/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ẖ̵̢̛̩͔̪̭̬̲̮̤̆͜͜e̵̡̬͙̥̖̹͈̞̲̞̻̜̾̂̅͐̎͒̔̕͝͝ĥ̶̢̛̳͕̠̳̥͉̩͂̎̓́̆̍̿́͐͆̓͠͝ͅè̷̡͖̬̘̹͇̼͑̔̓̾̋͌̔͑̿ 1 3.50
ẘ̶̢̛̜̖͕͖̈̔͂̂̈̐̏̋͠h̴̜̫̰͚͎͍̲̗͙̓̅̇̈̃ͅͅa̵̬͕̕t̶͔̺̼̬̠͂̏̃̈́̓͗͂́͝͝i̸̥͙͔̮̝̰̪̤̹̅̒͜͜s̴̢̹̙̹̺̪̠̱̪̩̳͒ţ̵̡̺̣͚̬̲̺̹͕̜̘̼͍̪͐̉̊̌́̉̇̔͊̃̑̕͝͝͝ḩ̷̨͙̠̝̙̪̰̜̻̟̻͕͇͌̉̈́͛̚ị̴̢̬̠́s̶̨͎̘̳̦̠̮͓͒̿́͐̊́̀̾̽̎͠ 1 5.00
2 changes: 2 additions & 0 deletions tests/hehe/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ẖ̵̢̛̩͔̪̭̬̲̮̤̆͜͜e̵̡̬͙̥̖̹͈̞̲̞̻̜̾̂̅͐̎͒̔̕͝͝ĥ̶̢̛̳͕̠̳̥͉̩͂̎̓́̆̍̿́͐͆̓͠͝ͅè̷̡͖̬̘̹͇̼͑̔̓̾̋͌̔͑̿ 100 1500 2000
ẘ̶̢̛̜̖͕͖̈̔͂̂̈̐̏̋͠h̴̜̫̰͚͎͍̲̗͙̓̅̇̈̃ͅͅa̵̬͕̕t̶͔̺̼̬̠͂̏̃̈́̓͗͂́͝͝i̸̥͙͔̮̝̰̪̤̹̅̒͜͜s̴̢̹̙̹̺̪̠̱̪̩̳͒ţ̵̡̺̣͚̬̲̺̹͕̜̘̼͍̪͐̉̊̌́̉̇̔͊̃̑̕͝͝͝ḩ̷̨͙̠̝̙̪̰̜̻̟̻͕͇͌̉̈́͛̚ị̴̢̬̠́s̶̨͎̘̳̦̠̮͓͒̿́͐̊́̀̾̽̎͠ 100 2000 3000
2 changes: 2 additions & 0 deletions tests/rounding/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ROUNDDOWN 1 0.09
ROUNDUP 1 0.10
2 changes: 2 additions & 0 deletions tests/rounding/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ROUNDDOWN 100 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 1 1 1 1 1
ROUNDUP 100 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1
2 changes: 2 additions & 0 deletions tests/space/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPAAACE 2 8.50
WOWSUCHEMPTY 1 5.00
3 changes: 3 additions & 0 deletions tests/space/in.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPAAACE 55 4500 4200
SPAAACE 56 4300 2333
WOWSUCHEMPTY 50 1 10000

0 comments on commit f235806

Please sign in to comment.