(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func TestTextVerbosityFromChat(t *testing.T) { |
| 129 | t.Parallel() |
| 130 | |
| 131 | tests := []struct { |
| 132 | name string |
| 133 | value *string |
| 134 | want *fantasyopenai.TextVerbosity |
| 135 | }{ |
| 136 | {name: "Nil"}, |
| 137 | {name: "Empty", value: ptr(" ")}, |
| 138 | {name: "Low", value: ptr(" low "), want: ptr(fantasyopenai.TextVerbosityLow)}, |
| 139 | {name: "MediumCase", value: ptr(" MEDIUM "), want: ptr(fantasyopenai.TextVerbosityMedium)}, |
| 140 | {name: "High", value: ptr("high"), want: ptr(fantasyopenai.TextVerbosityHigh)}, |
| 141 | {name: "Invalid", value: ptr("verbose")}, |
| 142 | } |
| 143 | |
| 144 | for _, tt := range tests { |
| 145 | t.Run(tt.name, func(t *testing.T) { |
| 146 | t.Parallel() |
| 147 | |
| 148 | got := chatopenai.TextVerbosityFromChat(tt.value) |
| 149 | if tt.want == nil { |
| 150 | require.Nil(t, got) |
| 151 | return |
| 152 | } |
| 153 | require.NotNil(t, got) |
| 154 | require.Equal(t, *tt.want, *got) |
| 155 | }) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | func TestIncludeFromChat(t *testing.T) { |
| 160 | t.Parallel() |
nothing calls this directly
no test coverage detected