Skip to content

Commit 0656fc2

Browse files
test: update comment test expectations for block comment fix
The ParseComment() function was updated to keep multi-line block comments as a single ast.Comment node (per Go's AST spec) instead of splitting them by newlines. This commit updates the test expectations to match the new correct behavior. Changes: - Multi-line block comments (/* ... */) now appear as one Comment node - Line comments (//) continue to be separate nodes per line Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
1 parent f26d750 commit 0656fc2

File tree

1 file changed

+4
-40
lines changed

1 file changed

+4
-40
lines changed

_xtool/internal/parser/testdata/comment/expect.json

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,7 @@
353353
"Doc": {
354354
"List": [
355355
{
356-
"Text": "/**\n",
357-
"_Type": "Comment"
358-
},
359-
{
360-
"Text": " * doc 1\n",
361-
"_Type": "Comment"
362-
},
363-
{
364-
"Text": " * doc 2\n",
365-
"_Type": "Comment"
366-
},
367-
{
368-
"Text": " */\n",
356+
"Text": "/**\n * doc 1\n * doc 2\n */\n",
369357
"_Type": "Comment"
370358
}
371359
],
@@ -524,15 +512,7 @@
524512
"Doc": {
525513
"List": [
526514
{
527-
"Text": "/**\n",
528-
"_Type": "Comment"
529-
},
530-
{
531-
"Text": " * static field doc\n",
532-
"_Type": "Comment"
533-
},
534-
{
535-
"Text": " */\n",
515+
"Text": "/**\n * static field doc\n */\n",
536516
"_Type": "Comment"
537517
}
538518
],
@@ -584,15 +564,7 @@
584564
"Doc": {
585565
"List": [
586566
{
587-
"Text": "/**\n",
588-
"_Type": "Comment"
589-
},
590-
{
591-
"Text": " * field doc\n",
592-
"_Type": "Comment"
593-
},
594-
{
595-
"Text": " */\n",
567+
"Text": "/**\n * field doc\n */\n",
596568
"_Type": "Comment"
597569
}
598570
],
@@ -672,15 +644,7 @@
672644
"Doc": {
673645
"List": [
674646
{
675-
"Text": "/**\n",
676-
"_Type": "Comment"
677-
},
678-
{
679-
"Text": " * method doc\n",
680-
"_Type": "Comment"
681-
},
682-
{
683-
"Text": " */\n",
647+
"Text": "/**\n * method doc\n */\n",
684648
"_Type": "Comment"
685649
}
686650
],

0 commit comments

Comments
 (0)