1 Star 0 Fork 16

王国平/SIP协议

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
request_line_test.go 628 Bytes
Copy Edit Raw Blame History
shallot authored 2020-04-05 12:24 . 添加SIP协议的解析代码。
package sip
import "testing"
func TestRequestLine(t *testing.T) {
tests := []struct {
name string
item string
wantErr bool
}{
{"reg", "REGISTER sip:192.168.0.2:5060 SIP/2.0", false},
{"ivt", "INVITE sip:1010@192.168.0.2 SIP/2.0", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
rl, err := NewRequestLine(tt.item)
if (err != nil) != tt.wantErr {
t.Errorf("RequestLine error = %v, wantErr %v", err, tt.wantErr)
}
if !tt.wantErr {
if str := rl.String(); str != tt.item {
t.Errorf("RequestLine string = %v, wantString %v", str, tt.item)
}
}
})
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/wang_guo_ping/sip.git
git@gitee.com:wang_guo_ping/sip.git
wang_guo_ping
sip
SIP协议
master

Search