File tree 2 files changed +27
-0
lines changed
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) {
445
445
}
446
446
}
447
447
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
+
448
464
func TestParseFileWithMetadata (t * testing.T ) {
449
465
wd , err := os .Getwd ()
450
466
if err != nil {
@@ -500,6 +516,17 @@ func TestParseTool(t *testing.T) {
500
516
}
501
517
}
502
518
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
+
503
530
func TestParseToolWithTextNode (t * testing.T ) {
504
531
tools , err := g .ParseTool (context .Background (), "echo hello\n ---\n !markdown\n hello" )
505
532
if err != nil {
You can’t perform that action at this time.
0 commit comments