Skip to content

Commit

Permalink
parser: more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Jul 29, 2024
1 parent 1f0477e commit 7d7f9b8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/gno/testdata/parsePackages-func.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
printSymbols
cmp stdout expected.json
-- x.gno --
package foo

func f(x int, y interface{ Foo() int }) bool {
return true
}
-- expected.json --
[
{
"Name": "script-parsePackages-func",
"ImportPath": ".",
"Symbols": [
{
"Name": "f",
"Signature": "func f(x int, y interface{ Foo() int }) bool",
"Kind": "func"
}
]
}
]
14 changes: 14 additions & 0 deletions internal/gno/testdata/parsePackages-interface.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type MyInterface interface {
type OtherInterface interface {
Bar() string
}

var x interface{ Baz(int) bool }
-- expected.json --
[
{
Expand Down Expand Up @@ -48,6 +50,18 @@ type OtherInterface interface {
"Kind": "method"
}
]
},
{
"Name": "x",
"Signature": "x interface{ Baz(int) bool }",
"Kind": "var",
"Fields": [
{
"Name": "Baz",
"Signature": "Baz(int) bool",
"Kind": "method"
}
]
}
]
}
Expand Down

0 comments on commit 7d7f9b8

Please sign in to comment.