aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_2056.odin
blob: 06bc11fbae4b1fef175ccb0d9a52e142cc3233b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Tests issue #2056 https://github.com/odin-lang/Odin/issues/2056
package test_issues

import "core:testing"

@test
test_scalar_matrix_conversion :: proc(t: ^testing.T) {
	l := f32(1.0)
	m := (matrix[4,4]f32)(l)

	for i in 0..<4 {
		for j in 0..<4 {
			if i == j {
				testing.expectf(t, m[i,j] == 1, "expected 1 at m[%d,%d], found %f\n", i, j, m[i,j])
			} else {
				testing.expectf(t, m[i,j] == 0, "expected 0 at m[%d,%d], found %f\n", i, j, m[i,j])
			}
		}
	}
}