feat: add move method to position
This commit is contained in:
@@ -3,6 +3,7 @@ package position_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/StevanFreeborn/advent-of-code-2025/internal/move"
|
||||
"github.com/StevanFreeborn/advent-of-code-2025/internal/position"
|
||||
)
|
||||
|
||||
@@ -20,3 +21,14 @@ func TestFrom(t *testing.T) {
|
||||
t.Errorf("expected column to be %d, got %d", column, pos.Column())
|
||||
}
|
||||
}
|
||||
|
||||
func TestMove(t *testing.T) {
|
||||
expectedPos := position.From(3, 4)
|
||||
startPos := position.From(2, 4)
|
||||
|
||||
result := startPos.Move(move.Down)
|
||||
|
||||
if result != expectedPos {
|
||||
t.Errorf("expected position to be %+v, got %+v", expectedPos, result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user