Maintain history; use state
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package state
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
@ -48,6 +49,24 @@ func TestState(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("You can maintain a history of all actions", func() {
|
||||
s.Flag()
|
||||
s.Mark()
|
||||
s.Clear()
|
||||
s.CursorSectionRight()
|
||||
s.CursorSectionLeft()
|
||||
s.CursorSectionDown()
|
||||
s.CursorSectionUp()
|
||||
s.CursorCellRight()
|
||||
s.CursorCellLeft()
|
||||
s.CursorCellDown()
|
||||
s.CursorCellUp()
|
||||
|
||||
matches, err := regexp.Match("gogogogogram 2 2:\n(i\\(\\d,\\d\\)[\b\x01]{4}){4}fmcRLDUrldu", []byte(s.History()))
|
||||
So(matches, ShouldBeTrue)
|
||||
So(err, ShouldBeNil)
|
||||
})
|
||||
|
||||
Convey("You can complete sections and clear portions of the board", func() {
|
||||
s.cells.vivify(Point{0, 0})
|
||||
s.cells.vivify(Point{2, 0})
|
||||
|
||||
Reference in New Issue
Block a user