|
271 | 271 | (rustic-test-babel-execute-block buf) |
272 | 272 | (should (eq (rustic-test-babel-check-results buf) nil))))) |
273 | 273 |
|
| 274 | +(ert-deftest rustic-test-babel-block-with-simple-var () |
| 275 | + (let* ((string "println!(\"{}\", A)") |
| 276 | + (params ":main yes :var A=\"A\"") |
| 277 | + (buf (rustic-test-get-babel-block string params))) |
| 278 | + (with-current-buffer buf |
| 279 | + (rustic-test-babel-execute-block buf) |
| 280 | + (should (string-equal (rustic-test-babel-check-results buf) "A\n"))))) |
| 281 | + |
| 282 | +(ert-deftest rustic-test-babel-block-with-list-var () |
| 283 | + (let* ((string "println!(\"{:?}\", A)") |
| 284 | + (params ":main yes :var A='(\"A\" \"B\")") |
| 285 | + (buf (rustic-test-get-babel-block string params))) |
| 286 | + (with-current-buffer buf |
| 287 | + (rustic-test-babel-execute-block buf) |
| 288 | + (should (string-equal (rustic-test-babel-check-results buf) "[\"A\", \"B\"]\n"))))) |
| 289 | + |
| 290 | +(ert-deftest rustic-test-babel-block-with-nested-list-var () |
| 291 | + (let* ((string "println!(\"{:?}\", A)") |
| 292 | + (params ":main yes :var A='((\"A\" \"B\") (\"C\" \"D\"))") |
| 293 | + (buf (rustic-test-get-babel-block string params))) |
| 294 | + (with-current-buffer buf |
| 295 | + (rustic-test-babel-execute-block buf) |
| 296 | + (should (string-equal (rustic-test-babel-check-results buf) "[[\"A\", \"B\"], [\"C\", \"D\"]]\n"))))) |
| 297 | + |
274 | 298 | (provide 'rustic-babel-test) |
0 commit comments