Skip to content

Commit

Permalink
test: custom enum type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
northes committed Apr 23, 2024
1 parent f3d15e1 commit d897175
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
23 changes: 23 additions & 0 deletions enum_chat_completions_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package moonshot_test

import (
"testing"

"github.com/northes/go-moonshot"
"github.com/stretchr/testify/require"
)

func TestEnumChatCompletions(t *testing.T) {
tt := require.New(t)

tt.EqualValues(moonshot.RoleSystem, moonshot.RoleSystem.String())
tt.EqualValues(moonshot.RoleUser, moonshot.RoleUser.String())
tt.EqualValues(moonshot.RoleAssistant, moonshot.RoleAssistant.String())

tt.EqualValues(moonshot.ModelMoonshotV18K, moonshot.ModelMoonshotV18K.String())
tt.EqualValues(moonshot.ModelMoonshotV132K, moonshot.ModelMoonshotV132K.String())
tt.EqualValues(moonshot.ModelMoonshotV1128K, moonshot.ModelMoonshotV1128K.String())

tt.EqualValues(moonshot.FinishReasonStop, moonshot.FinishReasonStop.String())
tt.EqualValues(moonshot.FinishReasonLength, moonshot.FinishReasonLength.String())
}
14 changes: 14 additions & 0 deletions enum_files_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package moonshot_test

import (
"testing"

"github.com/northes/go-moonshot"
"github.com/stretchr/testify/require"
)

func TestEnumFiles(t *testing.T) {
tt := require.New(t)

tt.EqualValues(moonshot.FilePurposeExtract, moonshot.FilePurposeExtract.String())
}

0 comments on commit d897175

Please sign in to comment.