File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,22 @@ func TestParseSimpleFile(t *testing.T) {
445445 }
446446}
447447
448+ func TestParseEmptyFile (t * testing.T ) {
449+ wd , err := os .Getwd ()
450+ if err != nil {
451+ t .Fatalf ("Error getting working directory: %v" , err )
452+ }
453+
454+ tools , err := g .Parse (context .Background (), wd + "/test/empty.gpt" )
455+ if err != nil {
456+ t .Errorf ("Error parsing file: %v" , err )
457+ }
458+
459+ if len (tools ) != 0 {
460+ t .Fatalf ("Unexpected number of tools: %d" , len (tools ))
461+ }
462+ }
463+
448464func TestParseFileWithMetadata (t * testing.T ) {
449465 wd , err := os .Getwd ()
450466 if err != nil {
@@ -500,6 +516,17 @@ func TestParseTool(t *testing.T) {
500516 }
501517}
502518
519+ func TestEmptyParseTool (t * testing.T ) {
520+ tools , err := g .ParseTool (context .Background (), "" )
521+ if err != nil {
522+ t .Errorf ("Error parsing tool: %v" , err )
523+ }
524+
525+ if len (tools ) != 0 {
526+ t .Fatalf ("Unexpected number of tools: %d" , len (tools ))
527+ }
528+ }
529+
503530func TestParseToolWithTextNode (t * testing.T ) {
504531 tools , err := g .ParseTool (context .Background (), "echo hello\n ---\n !markdown\n hello" )
505532 if err != nil {
You can’t perform that action at this time.
0 commit comments