feat(wip): code completion with llm

This commit is contained in:
Jacky 2025-04-15 21:54:51 +08:00
parent 63fb823344
commit a57748a432
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
22 changed files with 623 additions and 31 deletions

View file

@ -0,0 +1,23 @@
package llm
import (
"github.com/stretchr/testify/assert"
"regexp"
"testing"
)
func TestRegex(t *testing.T) {
content := `
server {
listen 80;
listen [::]:80;
server_name _;
include error_json;
}
`
pattern := regexp.MustCompile(`(?m)^\s*include\s+([^;]+);`)
matches := pattern.FindAllStringSubmatch(content, -1)
assert.Equal(t, 1, len(matches))
assert.Equal(t, "error_json", matches[0][1])
}