diff --git a/internal/test_cases/utils.go b/internal/test_cases/utils.go index 7f3dfeb7..f285b90c 100644 --- a/internal/test_cases/utils.go +++ b/internal/test_cases/utils.go @@ -49,7 +49,13 @@ func logReadableFileContents(logger *logger.Logger, fileContents string) { printableFileContents = regex2.ReplaceAllString(printableFileContents, "<|SPACE|>") for _, line := range strings.Split(printableFileContents, "\n") { - logger.Plainf(color.YellowString("[test.lox]") + " " + line) + if strings.Contains(line, "//") { + code := strings.Split(line, "//")[0] + comment := "//" + strings.Split(line, "//")[1] + logger.Plainf(color.YellowString("[test.lox]") + " " + color.YellowString(code) + " " + color.YellowString(comment)) + } else { + logger.Plainf(color.YellowString("[test.lox]") + " " + line) + } } }