File: command_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 (22 lines) | stat: -rw-r--r-- 543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package agimodels

import (
	"testing"

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

func TestBuild(t *testing.T) {
	for _, test := range []struct {
		S string
		C Command
	}{
		{S: "HANGUP 16", C: HangupCommand{}.SetChannelName("16")},
		{S: "CONTROL STREAM FILE fn #", C: ControlStreamFileCommand{FileName: "fn", EscapeDigits: "#"}},
		{S: "CONTROL STREAM FILE fn #", C: ControlStreamFileCommand{FileName: "fn", EscapeDigits: "#"}.SetPausechr("Abc")},
	} {
		s, err := test.C.Command()
		assert.NoError(t, err)
		assert.Equal(t, test.S, s)
	}
}