File: agi_test.go

package info (click to toggle)
golang-github-wenerme-astgo 0.0~git20230926.1b5bc38-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 612 kB
  • sloc: makefile: 16
file content (19 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package agi

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestParseResponse(t *testing.T) {
	for _, test := range []struct {
		L string
		R Response
	}{
		{L: "200 result=1", R: Response{Status: 200, Result: 1, ResultString: "1"}},
		{L: "200 result=0 endpos=8640", R: Response{Status: 200, Result: 0, ResultString: "0", Value: "endpos=8640"}},
	} {
		assert.Equal(t, &test.R, ParseResponse(test.L))
	}
}