package gpt

import (
	"fmt"
	"testing"
)

func TestGptContent(t *testing.T) {
	type args struct {
		content string
	}

	InitSet("https://erpapi.fontree.cn", "18021272627", "Gy.123456")
	tests := []struct {
		name    string
		args    args
		want    string
		wantErr bool
	}{
		{args: args{content: "i want many nice cars"}},
		{args: args{content: "you are so beautiful,i like(把前面文字翻译成中文,去除斜杠，本括号内的忽略)"}},
		{args: args{content: "有一个美丽的蓝色天空，天空下边站着一个小孩，小孩穿着绿色的衣服，绿色的帽子，帽子上有个毛毛虫(把前面文字翻译成英语,如果前面是英语则原样返回,去除斜杠，本括号内的忽略)"}},
		{args: args{content: "翻译成英语：当日密码错误2次，请重试"}},
		{args: args{content: "翻译成日语：当日密码错误2次，请重试"}},
		{args: args{content: "翻译成繁体：当日密码错误2次，请重试"}},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got, err := gptContent(tt.args.content)
			fmt.Println(got)
			if (err != nil) != tt.wantErr {
				t.Errorf("GptContent() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if got != tt.want {
				t.Errorf("GptContent() got = %v, want %v", got, tt.want)
			}
		})
	}
}
