Skip to content

Conversation

@Ph0enixKM
Copy link
Member

@Ph0enixKM Ph0enixKM commented Dec 2, 2025

This PR introduces naming test blocks:

// Unique named test blocks
test "identifier_name" {
  // ...
}

// One nameless block allowed
test {

}

What to do:

  • Remove ability to name tests with identifier (leave just the text/string names)
  • Make it possible to run a certain test or subset of tests (amber test . "variable" will run all tests that contain substring variable in their names)
  • Make it possible to run a specific test (amber test main.ab "Extracts from zip" will run all subset of tests that contain substring Extracts from zip in main.ab file).

This PR also introduces a new standard library std/test with assert(value) and assert_eq(left, right) functions.

Closes #844
Docs amber-lang/amber-docs#133

@Ph0enixKM Ph0enixKM linked an issue Dec 2, 2025 that may be closed by this pull request
@Ph0enixKM Ph0enixKM marked this pull request as draft December 2, 2025 21:24
@Ph0enixKM
Copy link
Member Author

Ph0enixKM commented Dec 3, 2025

It starts to look pretty cool.

import * from "std/test"

main {
    echo "hello, I'm not being called in tests!"
}

test {
    fail 1
}

test failing {
    assert(false)
}

test this {
    echo "test"
}
Screenshot 2025-12-03 at 01 22 06

@Ph0enixKM Ph0enixKM marked this pull request as ready for review December 8, 2025 23:11
@Ph0enixKM Ph0enixKM requested review from Mte90 and lens0021 December 8, 2025 23:11
@Ph0enixKM Ph0enixKM merged commit 4f7c6cb into staging Dec 10, 2025
14 checks passed
@Ph0enixKM Ph0enixKM deleted the 844-feature-dedicated-test-block-and-amber-test-command branch December 10, 2025 10:14
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.

[Feature] Dedicated Test block and amber test command

3 participants