Skip to content

Commit

Permalink
Adapt test to new gogen-avro v10 version
Browse files Browse the repository at this point in the history
  • Loading branch information
sixstone-qq committed Nov 14, 2022
1 parent a8454c0 commit 30f3b46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cmd/avsc2avdl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ func (g *generator) writeMetadata(d interface{}, indent string) {
if m.doc != "" {
g.printf("%s", indent)
if strings.Contains(m.doc, "\n") {
// This is dead-code by now https://github.com/actgardner/gogen-avro/pull/177
// as gogen-avro removes the whitespaces.
// idl2schemata strips leading and trailing whitespace,
// so put some back again if it's a multiline comment.
g.printf("/**\n%s %s\n%s */\n", indent, m.doc, indent)
Expand Down
7 changes: 2 additions & 5 deletions cmd/avsc2avdl/testdata/simple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cmp stdout expect.avdl
}, {
"name" : "fstrWithDefault",
"type" : "string",
"doc" : "* doc comment on field with\n\t\t * newline",
"doc" : "* doc comment on field with\n * newline",
"default" : ""
}, {
"name" : "fStrNoDefault",
Expand Down Expand Up @@ -90,10 +90,7 @@ protocol _ {
/** doc comment on field */
@fieldMetadata(245)
map<string> fmap;
/**
* doc comment on field with
* newline
*/
/** * doc comment on field with * newline */
string fstrWithDefault = "";
string fStrNoDefault = "";
@logicalType("timestamp-micros")
Expand Down

0 comments on commit 30f3b46

Please sign in to comment.