25 lines
718 B
Go
25 lines
718 B
Go
package ai
|
|
|
|
import (
|
|
"os"
|
|
"reflect"
|
|
"strings"
|
|
"testing"
|
|
|
|
doubaospeech "git.ipao.vip/rogee/doubao-speech-go"
|
|
)
|
|
|
|
func TestSpeechSDKIsOurPinnedIndependentModule(t *testing.T) {
|
|
if got := reflect.TypeOf(doubaospeech.Client{}).PkgPath(); got != "git.ipao.vip/rogee/doubao-speech-go" {
|
|
t.Fatalf("speech SDK is not our maintained module: %s", got)
|
|
}
|
|
raw, err := os.ReadFile("../../go.mod")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
text := string(raw)
|
|
if !strings.Contains(text, "git.ipao.vip/rogee/doubao-speech-go v") || strings.Contains(text, "github.com/GizClaw/doubao-speech-go") || strings.Contains(text, "./third_party/doubao-speech-go") {
|
|
t.Fatal("speech SDK is not pinned to its independent repository")
|
|
}
|
|
}
|