Skip to content

Conversation

@msanchezdev
Copy link

Fixes: #11

The idea is to be able to specify multiple tests in a single file to reduce the number of files, and keep tests scoped.

In order to allow differentiating between tests a test identifier can be added like in the examples below.

Two linefeeds are enough to separate on test from the other. Considered adding a customizable separator but I'm not sure that's needed.

test_one: First test example
=======
fn x() int {
    return 1;
}
=======
(source_file
  (function_definition
    (identifier: "x")
    (parameter_list)
    (primitive_type: "int")
    (block
      (inner_block
        (return_statement
          (number: "1")
        )
      )
    )
  )
)


test_two: Second test example
=======
fn y() bool {
    return true;
}
=======
(source_file
  (function_definition
    (identifier: "y")
    (parameter_list)
    (primitive_type: "bool")
    (block
      (inner_block
        (return_statement
          (boolean: "true")
        )
      )
    )
  )
)

@jdidion
Copy link
Owner

jdidion commented Nov 13, 2025

Thanks! Looked like the build failed on some linter issues https://github.com/jdidion/pest-test/actions/runs/18766822128. Once these are fixed up it should be good to merge.

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.

Add support for multiple tests in a single file

2 participants