chore: setup folders for aoc 2024
Some checks failed
Go Bump / bump (push) Failing after 9s
Go Test / build (push) Successful in 38s

This commit is contained in:
xuu 2024-10-26 11:38:38 -06:00
parent 50af2114d4
commit 3c9af95ec4
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F
92 changed files with 72 additions and 1 deletions

View File

0
aoc2024/day01/input.txt Normal file
View File

30
aoc2024/day01/main.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"bufio"
_ "embed"
"fmt"
aoc "go.sour.is/advent-of-code"
)
// var log = aoc.Log
func main() { aoc.MustResult(aoc.Runner(run)) }
type result struct {
valuePT1 int
valuePT2 int
}
func (r result) String() string { return fmt.Sprintf("%#v", r) }
func run(scan *bufio.Scanner) (*result, error) {
for scan.Scan() {
_ = scan.Text()
}
return &result{}, nil
}

View File

@ -0,0 +1,41 @@
package main
import (
"bufio"
"bytes"
"testing"
_ "embed"
"github.com/matryer/is"
)
//go:embed example.txt
var example []byte
//go:embed input.txt
var input []byte
func TestExample(t *testing.T) {
is := is.New(t)
scan := bufio.NewScanner(bytes.NewReader(example))
result, err := run(scan)
is.NoErr(err)
t.Log(result)
is.Equal(result.valuePT1, 0)
is.Equal(result.valuePT2, 0)
}
func TestSolution(t *testing.T) {
is := is.New(t)
scan := bufio.NewScanner(bytes.NewReader(input))
result, err := run(scan)
is.NoErr(err)
t.Log(result)
is.Equal(result.valuePT1, 0)
is.Equal(result.valuePT2, 0)
}

2
go.mod
View File

@ -1,6 +1,6 @@
module go.sour.is/advent-of-code
go 1.22.0
go 1.23.2
require (
github.com/matryer/is v1.4.1