Skip to content

Conversation

thevilledev
Copy link
Contributor

Add extensive test coverage for VM opcodes including:

  • Basic operations (OpLoadEnv, OpTrue, OpFalse, OpNil)
  • Arithmetic operations (OpNegate, OpExponent)
  • String operations (OpEqualString, OpMatches)
  • Collection operations (OpIn, OpLen)
  • Type operations (OpCast)
  • Control flow (OpThrow)
  • Function calls (OpCall0-3, OpCallN)
  • Index and count manipulation (OpGetIndex, OpSetIndex)
  • Profiling operations (OpProfileStart, OpProfileEnd)

Also add high-level expression tests for:

  • Arithmetic expressions
  • String operations
  • Data structure operations
  • Group and sort operations

Each test case includes detailed comments and covers both success and error cases.

These tests combined with a debugger helped me navigate the VM internals significantly.

Add extensive test coverage for VM opcodes including:

- Basic operations (OpLoadEnv, OpTrue, OpFalse, OpNil)
- Arithmetic operations (OpNegate, OpExponent)
- String operations (OpEqualString, OpMatches)
- Collection operations (OpIn, OpLen)
- Type operations (OpCast)
- Control flow (OpThrow)
- Function calls (OpCall0-3, OpCallN)
- Index and count manipulation (OpGetIndex, OpSetIndex)
- Profiling operations (OpProfileStart, OpProfileEnd)

Also add high-level expression tests for:
- Arithmetic expressions
- String operations
- Data structure operations
- Group and sort operations

Each test case includes detailed comments and covers both success and error cases.

These tests combined with a debugger helped me navigate the VM internals
significantly.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
@antonmedv
Copy link
Member

Awesome! Cool to see nice tests added.

@antonmedv
Copy link
Member

Coverage increases: 91% => 91.3%

@antonmedv antonmedv merged commit 6ef04ec into expr-lang:master Jan 27, 2025
12 checks passed
@thevilledev thevilledev deleted the test/improved-vm-tests branch January 27, 2025 15:37
SimFG pushed a commit to SimFG/expr that referenced this pull request Apr 15, 2025
Add extensive test coverage for VM opcodes including:

- Basic operations (OpLoadEnv, OpTrue, OpFalse, OpNil)
- Arithmetic operations (OpNegate, OpExponent)
- String operations (OpEqualString, OpMatches)
- Collection operations (OpIn, OpLen)
- Type operations (OpCast)
- Control flow (OpThrow)
- Function calls (OpCall0-3, OpCallN)
- Index and count manipulation (OpGetIndex, OpSetIndex)
- Profiling operations (OpProfileStart, OpProfileEnd)

Also add high-level expression tests for:
- Arithmetic expressions
- String operations
- Data structure operations
- Group and sort operations

Each test case includes detailed comments and covers both success and error cases.

These tests combined with a debugger helped me navigate the VM internals
significantly.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
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

Successfully merging this pull request may close these issues.

2 participants