func (assembler *LineList) ParseInOut(currentLine string) error { source := token.NewSource(currentLine) temp := line.NewInOut() err := temp.Parse(source) if err != nil { return err } assembler.Lines = append(assembler.Lines, temp) return nil }
func TestInOutParse(t *testing.T) { testCaseList := []testCaseForTestInOutParse{ {data: ` IN BUFF, LEN`}, {data: ` OUT MSG2, MLEN ; COMMENT`}, {data: `OK OUT MSG1, MLEN ; COMMENT`}, } for _, testCase := range testCaseList { testData := testCase.data inout := line.NewInOut() source := token.NewSource(testData) err := inout.Parse(source) if err != nil { t.Error(err) } // t.Error(inout) } }