From 6af3affee2f4c3cb61c7d8609d970c7cf5b82862 Mon Sep 17 00:00:00 2001 From: JT Date: Tue, 7 Sep 2021 19:09:49 +1200 Subject: [PATCH] add a test and update TODO --- TODO.md | 2 +- src/tests.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 6f2b6e3626..5a2cb05062 100644 --- a/TODO.md +++ b/TODO.md @@ -16,7 +16,7 @@ - [x] Ranges - [x] Column path - [x] ...rest without calling it rest -- [ ] Iteration (`each`) over tables +- [x] Iteration (`each`) over tables - [ ] ctrl-c support - [ ] operator overflow - [ ] finish operator type-checking diff --git a/src/tests.rs b/src/tests.rs index 1d8e9c80a2..403d9d2b30 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -279,3 +279,11 @@ fn cell_path_var2() -> TestResult { fn custom_rest_var() -> TestResult { run_test("def foo [...x] { $x.0 + $x.1 }; foo 10 80", "90") } + +#[test] +fn row_iteration() -> TestResult { + run_test( + "[[name, size]; [tj, 100], [rl, 200]] | each { $it.size * 8 }", + "[800, 1600]", + ) +}