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

Test language semantics #539

Open
6 of 14 tasks
anton-trunov opened this issue Jul 10, 2024 · 1 comment
Open
6 of 14 tasks

Test language semantics #539

anton-trunov opened this issue Jul 10, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@anton-trunov
Copy link
Member

anton-trunov commented Jul 10, 2024

Related docs issue: tact-lang/tact-docs#251

List of planned semantical tests

Expressions, statements

  • In functions: pass by value of structs, maps, and contracts (i.e., parameters in functions are copies).
  • In assignments: structs, maps and contracts are copied (i.e., assigned by value).
  • In mutating functions: structs, maps and contracts are modified if they are the first parameter.
  • Mutating functions chaining for structs, maps, contracts, integers.
  • Nested maps
  • Augment the tests in try-catch.spec.ts with structs, maps, and contracts.
  • Check that && and || short-circuit.

Variable scoping

Contracts

  • Since contract copies can have their own state but still call contract functions, verify if this produces conflicting results with the original contract when calling library functions. This may include obtaining addresses, sending messages, etc.
  • Check that it is possible to update the state of the original contract using a contract copy.
  • Since messages are sent in a different phase, carry out tests that produce errors in the second phase for example.
  • Check injectivity of addresses: two contracts with the same code but different initial data have different addresses, two contracts with the same initial data but different code have different addresses.
  • Test sending messages with different sending modes.
  • Test that receive("foo") takes precedence over receive(s: String) { if (s == "foo") { ... } }

Stdlib

  • In the library documentation, many functions have notes and warnings describing some semantical behavior, test those.

Exit codes

@anton-trunov
Copy link
Member Author

@jeshecdom Can you please write a small plan in my original post (you can edit it)? The first step 'structs' is already done and you already have planned to work with maps, so let's just document the plan here, in this issue

@tact-lang tact-lang deleted a comment from jeshecdom Sep 13, 2024
@anton-trunov anton-trunov modified the milestones: v1.5.0, v1.6.0 Sep 15, 2024
@anton-trunov anton-trunov changed the title Test assignment and function arguments passing semantics Test language semantics Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants