diff --git a/internal/database/database_test.go b/internal/database/database_test.go index 862e74e..11200cc 100644 --- a/internal/database/database_test.go +++ b/internal/database/database_test.go @@ -266,6 +266,29 @@ func testOptionsSearch(t *testing.T, store Store) { if len(results) > 2 { t.Errorf("Expected at most 2 results, got %d", len(results)) } + + // Search with special characters (dots) - should not cause syntax errors + results, err = store.SearchOptions(ctx, rev.ID, "services.nginx", SearchFilters{}) + if err != nil { + t.Fatalf("SearchOptions with dots failed: %v", err) + } + if len(results) < 1 { + t.Errorf("Expected at least 1 result for 'services.nginx', got %d", len(results)) + } + + // Search with other special characters + specialQueries := []string{ + "services.nginx.enable", + "nginx:package", + "web-server", + "(nginx)", + } + for _, q := range specialQueries { + _, err = store.SearchOptions(ctx, rev.ID, q, SearchFilters{}) + if err != nil { + t.Errorf("SearchOptions with special query %q failed: %v", q, err) + } + } } func testOptionChildren(t *testing.T, store Store) {