re-organise repo

This commit is contained in:
2023-11-16 10:48:53 +00:00
parent f62c52d8a9
commit f133e157a1
87 changed files with 11792 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
package day07
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPart1(t *testing.T) {
r := Part1(
`$ cd /
$ ls
dir a
14848514 b.txt
8504156 c.dat
dir d
$ cd a
$ ls
dir e
29116 f
2557 g
62596 h.lst
$ cd e
$ ls
584 i
$ cd ..
$ cd ..
$ cd d
$ ls
4060174 j
8033020 d.log
5626152 d.ext
7214296 k`)
require.Equal(t, 95437, r)
}
func TestPart2(t *testing.T) {
r := Part2(
`$ cd /
$ ls
dir a
14848514 b.txt
8504156 c.dat
dir d
$ cd a
$ ls
dir e
29116 f
2557 g
62596 h.lst
$ cd e
$ ls
584 i
$ cd ..
$ cd ..
$ cd d
$ ls
4060174 j
8033020 d.log
5626152 d.ext
7214296 k`)
require.Equal(t, 24933642, r)
}