-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
159 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Test with a valid sample.gnoffee | ||
|
||
gnoffee -w . | ||
|
||
! stderr .+ | ||
! stdout .+ | ||
|
||
cmp gen.golden gnoffee.gen.go | ||
|
||
-- sample.gnoffee -- | ||
package sample | ||
|
||
type foo struct{} | ||
|
||
export baz as Bar | ||
|
||
var baz = foo{} | ||
|
||
func (f *foo) Hello() string { | ||
return "Hello from foo!" | ||
} | ||
|
||
func (f *foo) Bye() { | ||
println("Goodbye from foo!") | ||
} | ||
|
||
type Bar interface { | ||
Hello() string | ||
Bye() | ||
} | ||
|
||
-- gen.golden -- | ||
package sample | ||
|
||
// This function was generated by gnoffee due to the export directive. | ||
func Hello() string { | ||
return baz.Hello() | ||
} | ||
|
||
// This function was generated by gnoffee due to the export directive. | ||
func Bye() { | ||
baz.Bye() | ||
} | ||
|
||
type foo struct{} | ||
|
||
var baz = foo{} | ||
|
||
func (f *foo) Hello() string { | ||
return "Hello from foo!" | ||
} | ||
|
||
func (f *foo) Bye() { | ||
println("Goodbye from foo!") | ||
} | ||
|
||
type Bar interface { | ||
Hello() string | ||
Bye() | ||
} |
This file was deleted.
Oops, something went wrong.