refactor: move issue #1370 regression tests from _cmptest to _demo
Move the three regression test cases for issue #1370 from _cmptest/ to _demo/: - issue1370_gotypes (go/types.Object test) - issue1370_goast (go/ast.Expr test) - issue1370_geometry (custom interface test) Updated import path in geometry.go to reflect new location. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
This commit is contained in:
25
_demo/issue1370_goast/goast.go
Normal file
25
_demo/issue1370_goast/goast.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ident := &ast.Ident{
|
||||
NamePos: token.Pos(42),
|
||||
Name: "foo",
|
||||
}
|
||||
|
||||
var expr ast.Expr = ident
|
||||
pos := expr.Pos()
|
||||
|
||||
fmt.Printf("Position: %d\n", pos)
|
||||
if pos != 42 {
|
||||
println("FAIL: Position mismatch")
|
||||
return
|
||||
}
|
||||
|
||||
println("SUCCESS: ast.Expr interface method calls work correctly")
|
||||
}
|
||||
Reference in New Issue
Block a user