Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions evaluate/task/test-integration/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func TestWriteTestsRun(t *testing.T) {
Setup: func(t *testing.T) {
var query any = bytesutil.StringTrimIndentations(`
Given the following Rust code file "src/plain.rs", provide tests for this code that can be appended to the source file.
Add everything required for testing, but do not repeat the original file and do not try to import the code file.
The tests should produce 100 percent code coverage and must compile.
The response must contain only the test code in a fenced code block and nothing else.

Expand Down
3 changes: 3 additions & 0 deletions model/llm/llm.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ type llmWriteTestSourceFilePromptContext struct {
// llmWriteTestForFilePromptTemplate is the template for generating an LLM test generation prompt.
var llmWriteTestForFilePromptTemplate = template.Must(template.New("model-llm-write-test-for-file-prompt").Parse(bytesutil.StringTrimIndentations(`
Given the following {{ .Language.Name }} code file "{{ .FilePath }}" {{- with .ImportPath }} with package "{{ . }}" {{- end }}, {{- if .HasTestsInSource }} provide tests for this code that can be appended to the source file{{ else }} provide a test file for this code{{ with .TestFramework }} with {{ . }} as a test framework{{ end }}{{ end -}}.
{{- if .HasTestsInSource }}
Add everything required for testing, but do not repeat the original file and do not try to import the code file.
{{- end }}
The tests should produce 100 percent code coverage and must compile.
The response must contain only the test code in a fenced code block and nothing else.

Expand Down
1 change: 1 addition & 0 deletions model/llm/llm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ func TestFormatPromptContext(t *testing.T) {

ExpectedMessage: bytesutil.StringTrimIndentations(`
Given the following Rust code file "path/to/main.rs", provide tests for this code that can be appended to the source file.
Add everything required for testing, but do not repeat the original file and do not try to import the code file.
The tests should produce 100 percent code coverage and must compile.
The response must contain only the test code in a fenced code block and nothing else.

Expand Down
Loading