Skip to content

Commit

Permalink
gopyerrors is not applicable any more.
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-rudderstack committed Jul 4, 2022
1 parent 9020e61 commit a44f1e5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 70 deletions.
29 changes: 0 additions & 29 deletions _examples/gopyerrors/gopyerrors.go

This file was deleted.

13 changes: 0 additions & 13 deletions _examples/gopyerrors/test.py

This file was deleted.

28 changes: 0 additions & 28 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,34 +109,6 @@ func TestGofmt(t *testing.T) {
}
}

func TestGoPyErrors(t *testing.T) {
pyvm := testBackends["py3"]
workdir, err := ioutil.TempDir("", "gopy-")
if err != nil {
t.Fatalf("could not create workdir: %v\n", err)
}
t.Logf("pyvm: %s making work dir: %s\n", pyvm, workdir)
defer os.RemoveAll(workdir)

curPkgPath := reflect.TypeOf(pkg{}).PkgPath()
fpath := filepath.Join(curPkgPath, "_examples/gopyerrors")
cmd := exec.Command("go", "run", ".", "gen", "-vm="+pyvm, "-output="+workdir, fpath)
t.Logf("running: %v\n", cmd.Args)
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("could not run %v: %+v\n", strings.Join(cmd.Args, " "), err)
}
contains := `--- Processing package: github.com/rudderlabs/gopy/_examples/gopyerrors ---
ignoring python incompatible function: .func github.com/rudderlabs/gopy/_examples/gopyerrors.NotErrorMany() (int, int): func() (int, int): gopy: second result value must be of type error: func() (int, int)
ignoring python incompatible method: gopyerrors.func (*github.com/rudderlabs/gopy/_examples/gopyerrors.Struct).NotErrorMany() (int, string): func() (int, string): gopy: second result value must be of type error: func() (int, string)
ignoring python incompatible method: gopyerrors.func (*github.com/rudderlabs/gopy/_examples/gopyerrors.Struct).TooMany() (int, int, string): func() (int, int, string): gopy: too many results to return: func() (int, int, string)
ignoring python incompatible function: .func github.com/rudderlabs/gopy/_examples/gopyerrors.TooMany() (int, int, string): func() (int, int, string): gopy: too many results to return: func() (int, int, string)
`
if got, want := string(out), contains; !strings.Contains(got, want) {
t.Fatalf("%v does not contain\n%v\n", got, want)
}
}

func TestHi(t *testing.T) {
// t.Parallel()
path := "_examples/hi"
Expand Down

0 comments on commit a44f1e5

Please sign in to comment.