Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More unit-tests and types for generated types #1

Open
ingvagabund opened this issue Mar 14, 2017 · 0 comments
Open

More unit-tests and types for generated types #1

ingvagabund opened this issue Mar 14, 2017 · 0 comments
Assignees

Comments

@ingvagabund
Copy link
Contributor

ingvagabund commented Mar 14, 2017

We need more definitions of various types (possibly with multiple level of recursion) to test generated types. Anything from structs in struct to interface with functions, some of them with function types, etc.

This will be needed very soon so are highly confident the generated code is usable and error prune for upcoming modifications (and extensions).

In case cases it make sense to generate the tests. E.g.

symboltable:
- "var MyInt int"
- "type MyStruct struct {...}"
- "func MyFunc(MyInt) int"
- "func MyFuncStr(MyInt) string"
targets:
- target: "parseBinaryExpr"
  tests:
  - code: "MyInt(2) + 3"
    expected: "MyInt"
  - code: "MyFunc(MyInt(3)) + MyFunc(MyInt(3))"
    expected: "int"
  - code: "MyInt(MyFunc(MyInt(3))) + MyFunc(MyInt(3))"
    expected: "MyInt"
- target: "parseCallExpr"
  tests:
  - code: "MyFunc(MyInt(3))"
    expected: "int"
  - code: "MyFuncStr(MyInt(2))"
    expected: "string"
@pirat89 pirat89 self-assigned this Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants