test_core_container.odin 571 B

1234567891011121314151617181920212223242526
  1. package test_core_container
  2. import "core:fmt"
  3. import "core:testing"
  4. import tc "tests:common"
  5. expect_equal :: proc(t: ^testing.T, the_slice, expected: []int, loc := #caller_location) {
  6. _eq :: proc(a, b: []int) -> bool {
  7. if len(a) != len(b) do return false
  8. for a, i in a {
  9. if b[i] != a do return false
  10. }
  11. return true
  12. }
  13. tc.expect(t, _eq(the_slice, expected), fmt.tprintf("Expected %v, got %v\n", the_slice, expected), loc)
  14. }
  15. main :: proc() {
  16. t := testing.T{}
  17. test_avl(&t)
  18. test_small_array(&t)
  19. tc.report(&t)
  20. }