mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-15 15:10:49 +00:00
26 lines
605 B
Go
26 lines
605 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/go-playground/assert/v2"
|
|
)
|
|
|
|
func TestCompareLists(t *testing.T) {
|
|
//t.Skip("skipping test")
|
|
t.Run("Should find 4 matches", func(t *testing.T) {
|
|
res, _ := compareLists("41 48 83 86 17", "83 86 6 31 17 9 48 53")
|
|
assert.Equal(t, 4, res)
|
|
})
|
|
|
|
t.Run("Should find 2 matches", func(t *testing.T) {
|
|
res, _ := compareLists(" 1 21 53 59 44 ", "69 82 63 72 16 21 14 1")
|
|
assert.Equal(t, 2, res)
|
|
})
|
|
|
|
t.Run("Should find 0 matches", func(t *testing.T) {
|
|
res, _ := compareLists("87 83 26 28 32", "88 30 70 12 93 22 82 36")
|
|
assert.Equal(t, 0, res)
|
|
})
|
|
}
|