mirror of
https://github.com/RussellChamp/advent-of-code-2021.git
synced 2026-10-27 21:52:32 +00:00
day 8 work and jumbled together
This commit is contained in:
1 parent
e76cb1a355
commit
c7ea0afedc
18 files changed
+457
-21
No files matched your search
+2
-2
@@ -37,8 +37,8 @@ func part1() {
|
||||
fmt.Println(" Answer: How many measurements are larger than the previous measurement?")
|
||||
|
||||
input, err := os.Open("./input.txt")
|
||||
defer input.Close()
|
||||
check(err)
|
||||
defer input.Close()
|
||||
|
||||
scanner := bufio.NewScanner(input)
|
||||
|
||||
@@ -67,8 +67,8 @@ func part2() {
|
||||
fmt.Println(" Answer: How many sums are larger than the previous sum?")
|
||||
|
||||
input, err := os.Open("./input.txt")
|
||||
defer input.Close()
|
||||
check(err)
|
||||
defer input.Close()
|
||||
|
||||
scanner := bufio.NewScanner(input)
|
||||
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
assert "AoC2021/utils/testing"
|
||||
"AoC2021/utils/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPrintPip(t *testing.T) {
|
||||
DEBUG = false
|
||||
str := GetPip(1, 1, 1, 100)
|
||||
assert.StrEquals(t, str, "", "Should return an empty string")
|
||||
assert.EqualsStr(t, str, "", "Should return an empty string")
|
||||
|
||||
DEBUG = true
|
||||
cases := []struct {
|
||||
@@ -24,7 +24,7 @@ func TestPrintPip(t *testing.T) {
|
||||
|
||||
for _, c := range cases {
|
||||
str := GetPip(c.first, c.previous, c.current, c.total)
|
||||
assert.StrEquals(t, str, c.expected, c.msg)
|
||||
assert.EqualsStr(t, str, c.expected, c.msg)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user