10000 Add minimal example to see test fail successfully · flokoe/adventofcode-2023-golang@759d252 · GitHub
[go: up one dir, main page]

Skip to content

Commit 759d252

Browse files
committed
Add minimal example to see test fail successfully
1 parent 2ecee42 commit 759d252

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

01-trebuchet/main.go

Lines changed: 11 additions & 0 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func CalibrationSum() int {
6+
return 0
7+
}
8+
9+
func main() {
10+
fmt.Println("Sum of calibration values:", CalibrationSum())
11+
}

01-trebuchet/main_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import "testing"
4+
5+
func TestCalibrationSum(t *testing.T) {
6+
got := CalibrationSum()
7+
want := 142
8+
9+
if got != want {
10+
t.Errorf("got %d, wanted %d", got, want)
11+
}
12+
}

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/flokoe/adventofcode-2023-golang
2+
3+
go 1.21.4

0 commit comments

Comments
 (0)
0