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

Testing framework #18

Merged
merged 4 commits into from
May 29, 2024
Merged

Testing framework #18

merged 4 commits into from
May 29, 2024

Conversation

AjaniBilby
Copy link
Member

Added primitive automated unit tests for salient, use the salient test command, then list all of the files or folders you want to test over. It will then look for all .test.sa files and compile the unit tests, then run them and validate they all return true.

Example test unit test file:

fn fib_recur(n: i32): i32 {
	if n <= 1 { return n; };
	return fib_recur(n - 1) + fib_recur(n - 2);
}

test "fibonacci recursive call" {
	if fib_recur(3) != 2 { return false; };

	return true;
}

@AjaniBilby AjaniBilby added the enhancement New feature or request label May 29, 2024
@AjaniBilby AjaniBilby self-assigned this May 29, 2024
@AjaniBilby AjaniBilby merged commit fad3e20 into main May 29, 2024
1 check passed
@AjaniBilby AjaniBilby deleted the testing-framework branch May 29, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant