From 43a997529328c0ebbe50b79ccb6ad830abbcd983 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Aug 2021 19:54:25 -0600 Subject: Fix that failing test --- cmd.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cmd.go') diff --git a/cmd.go b/cmd.go index 73ea14c..77b1d67 100644 --- a/cmd.go +++ b/cmd.go @@ -33,6 +33,11 @@ package libfastimport type fiReader interface { PeekLine() (string, error) ReadLine() (string, error) + SetCommandMark(int) +} + +type fiReaderState interface { + GetCommandMark() int } type fiWriter interface { @@ -54,9 +59,13 @@ const ( type Cmd interface { fiCmdRead(fiReader) (Cmd, error) fiCmdWrite(fiWriter) error - fiCmdClass() cmdClass + fiCmdClass(fiReaderState) cmdClass } -func cmdIs(cmd Cmd, class cmdClass) bool { - return cmd.fiCmdClass()&class != 0 +type noopReaderState struct{} + +func (_ noopReaderState) GetCommandMark() int { return 0 } + +func cmdIs(state fiReaderState, cmd Cmd, class cmdClass) bool { + return cmd.fiCmdClass(state)&class != 0 } -- cgit v1.2.3-2-g168b