mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-07 05:23:12 +00:00
Setup default context.random_generator for tests
This commit is contained in:
@@ -9,6 +9,7 @@ import "core:encoding/ansi"
|
||||
import "core:fmt"
|
||||
import "core:io"
|
||||
@require import pkg_log "core:log"
|
||||
import "core:math/rand"
|
||||
import "core:mem"
|
||||
import "core:os"
|
||||
import "core:slice"
|
||||
@@ -108,6 +109,9 @@ run_test_task :: proc(task: thread.Task) {
|
||||
|
||||
free_all(context.temp_allocator)
|
||||
|
||||
random_generator_state := rand.create(data.t.seed)
|
||||
context.random_generator = rand.default_random_generator(&random_generator_state)
|
||||
|
||||
data.it.p(&data.t)
|
||||
|
||||
end_t(&data.t)
|
||||
|
||||
Reference in New Issue
Block a user