mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
cleanup tests
This commit is contained in:
@@ -127,11 +127,13 @@ test_sort_by_indices :: proc(t: ^testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
indices := make([]int, test_size)
|
indices := make([]int, test_size)
|
||||||
|
defer delete(indices)
|
||||||
for _, i in indices {
|
for _, i in indices {
|
||||||
indices[i] = i
|
indices[i] = i
|
||||||
}
|
}
|
||||||
|
|
||||||
sorted_indices := slice.sort_by_indices(indices, f_idx)
|
sorted_indices := slice.sort_by_indices(indices, f_idx)
|
||||||
|
defer delete(sorted_indices)
|
||||||
for v, i in sorted_indices {
|
for v, i in sorted_indices {
|
||||||
idx_pass := v == f_idx[i]
|
idx_pass := v == f_idx[i]
|
||||||
expect(t, idx_pass, "Expected the sorted index to be the same as the result from sort_with_indices")
|
expect(t, idx_pass, "Expected the sorted index to be the same as the result from sort_with_indices")
|
||||||
@@ -142,6 +144,7 @@ test_sort_by_indices :: proc(t: ^testing.T) {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
indices := make([]int, test_size)
|
indices := make([]int, test_size)
|
||||||
|
defer delete(indices)
|
||||||
for _, i in indices {
|
for _, i in indices {
|
||||||
indices[i] = i
|
indices[i] = i
|
||||||
}
|
}
|
||||||
@@ -158,6 +161,10 @@ test_sort_by_indices :: proc(t: ^testing.T) {
|
|||||||
{
|
{
|
||||||
indices := make([]int, test_size)
|
indices := make([]int, test_size)
|
||||||
swap := make([]int, test_size)
|
swap := make([]int, test_size)
|
||||||
|
defer {
|
||||||
|
delete(indices)
|
||||||
|
delete(swap)
|
||||||
|
}
|
||||||
for _, i in indices {
|
for _, i in indices {
|
||||||
indices[i] = i
|
indices[i] = i
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user