@@ -142,7 +142,7 @@ func testMain(
142
142
red .Fprintf (output , "✗ %s\n " , document .RelativePath )
143
143
144
144
for _ , failure := range failures {
145
- fmt .Fprintf (output , indent (failure , 4 ))
145
+ fmt .Fprintf (output , indent (failure , 4 )+ " \n " )
146
146
}
147
147
} else {
148
148
green := color .New (color .FgGreen )
@@ -421,21 +421,31 @@ func (s symbolAttributeTestCase) check(attr symbolAttribute) bool {
421
421
422
422
func formatFailure (lineNumber int , testCase symbolAttributeTestCase , attributesAtLine []symbolAttribute ) string {
423
423
failureDesc := []string {
424
- fmt .Sprintf ("Failure - row : %d, column : %d" , lineNumber , testCase .attribute .start ),
424
+ fmt .Sprintf ("Failure [Ln : %d, Col : %d] " , lineNumber + 1 , testCase .attribute .start ),
425
425
fmt .Sprintf (" Expected: '%s %s'" , testCase .attribute .kind , testCase .attribute .data ),
426
426
}
427
427
for _ , add := range testCase .attribute .additionalData {
428
428
failureDesc = append (failureDesc , indent (fmt .Sprintf ("'%s'" , add ), 12 ))
429
429
}
430
430
431
- failureDesc = append (failureDesc , " Actual:" )
432
431
if (len (attributesAtLine )) == 0 {
433
- failureDesc = append (failureDesc , " - No attributes found" )
432
+ failureDesc = append (failureDesc , " Actual: <no attributes found> " )
434
433
} else {
435
- for _ , attr := range attributesAtLine {
436
- failureDesc = append (failureDesc , fmt .Sprintf (" - '%s %s'" , attr .kind , attr .data ))
434
+ for i , attr := range attributesAtLine {
435
+ prefix := " "
436
+ if i == 0 {
437
+ prefix = "Actual:"
438
+ }
439
+
440
+ if len (attributesAtLine ) > 1 {
441
+ prefix += " *"
442
+ } else {
443
+ prefix += " "
444
+ }
445
+
446
+ failureDesc = append (failureDesc , fmt .Sprintf (" %s '%s %s'" , prefix , attr .kind , attr .data ))
437
447
for _ , add := range attr .additionalData {
438
- failureDesc = append (failureDesc , indent (fmt .Sprintf ("'%s'" , add ), 6 ))
448
+ failureDesc = append (failureDesc , indent (fmt .Sprintf ("'%s'" , add ), 12 ))
439
449
}
440
450
}
441
451
}
0 commit comments