File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 77 "strings"
88
99 "github.com/codecrafters-io/tester-utils/logger"
10- "github.com/fatih/color"
1110)
1211
1312func createTempFileWithContents (contents string ) (string , error ) {
@@ -48,8 +47,14 @@ func logReadableFileContents(logger *logger.Logger, fileContents string) {
4847 printableFileContents = regex1 .ReplaceAllString (printableFileContents , "<|SPACE|>" )
4948 printableFileContents = regex2 .ReplaceAllString (printableFileContents , "<|SPACE|>" )
5049
50+ // This is of the form "test-N"
51+ oldPrefix := logger .GetSecondaryPrefix ()
52+ testNumber := strings .TrimPrefix (oldPrefix , "test-" )
53+ logger .UpdateSecondaryPrefix (fmt .Sprintf ("test-%s.lox" , testNumber ))
54+ defer logger .UpdateSecondaryPrefix (oldPrefix )
55+
5156 for _ , line := range strings .Split (printableFileContents , "\n " ) {
52- logger .Plainf (color . YellowString ( "[test.lox]" ) + " " + line )
57+ logger .Plainf (line )
5358 }
5459}
5560
You can’t perform that action at this time.
0 commit comments