Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 9d0a06f

Browse files
committed
test transpose matrix
1 parent bda9265 commit 9d0a06f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/bin/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ use std::rc::Rc;
99
fn main() -> Result<(),MechError> {
1010

1111
let input = r#"
12-
x = [1 2 3]
13-
#test = x ** x'"#;
12+
x = [1 2; 3 4]
13+
y = x ** x'
14+
#test = stats/sum(table: y)"#;
1415
let input = String::from(input);
1516

1617
let mut ast = Ast::new();

tests/compiler.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ test_mech!(math_matrix_transpose_row,"
254254
x = [1 2 3]
255255
#test = x ** x'", Value::F32(F32::new(14.0)));
256256

257+
test_mech!(math_matrix_transpose_matrix,"
258+
x = [1 2; 3 4]
259+
y = x ** x'
260+
#test = stats/sum(table: y)", Value::F32(F32::new(52.0)));
261+
257262
test_mech!(math_divide,"#test = 4 / 2", Value::F32(F32::new(2.0)));
258263

259264
test_mech!(math_power,"#test = 3 ^ 2", Value::F32(F32::new(9.0)));

0 commit comments

Comments
 (0)