From 551891e2ad78e14e7893fa7c7ef70e550cc107d9 Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Sun, 14 Sep 2014 10:43:37 +0200 Subject: [PATCH] Table formula: Add ERT for Lisp return values * testing/lisp/test-org-table.el (test-org-table/lisp-return-value): Add test with TODO. --- testing/lisp/test-org-table.el | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index c9631e7b5..530bc8ff9 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -393,6 +393,44 @@ reference (with row). Mode string N." " 1 calc))) +(ert-deftest test-org-table/lisp-return-value () + "Basic: Return value of Lisp formulas." + (org-test-table-target-expect + " +| | nil | (list) | '() | +|-------------------------+-------------+--------+-----| +| type-of, no L | replace (r) | r | r | +| type-of identity, no L | r | r | r | +| identity, no L | r | r | r | +|-------------------------+-------------+--------+-----| +| type-of \"@1\" | r | r | r | +| type-of (identity \"@1\") | r | r | r | +| identity \"@1\" | r | r | r | +|-------------------------+-------------+--------+-----| +| type-of @1 | r | r | r | +| type-of (identity @1) | r | r | r | +| identity @1 | r | r | r | +" + ;; TODO Fix "#ERROR". + " +| | nil | (list) | '() | +|-------------------------+--------+--------+--------| +| type-of, no L | string | string | string | +| type-of identity, no L | string | string | string | +| identity, no L | nil | (list) | '() | +|-------------------------+--------+--------+--------| +| type-of \"@1\" | string | string | string | +| type-of (identity \"@1\") | string | string | string | +| identity \"@1\" | nil | (list) | '() | +|-------------------------+--------+--------+--------| +| type-of @1 | symbol | symbol | symbol | +| type-of (identity @1) | symbol | symbol | symbol | +| identity @1 | #ERROR | #ERROR | #ERROR | +" + 1 (concat "#+TBLFM: @2$<<..@2$> = '(type-of @1) :: " + "@3$<<..@3$> = '(type-of (identity @1)) :: " + "@4$<<..@4$> = '(identity @1) :: @5$<<..@>$> = '(@0$1); L"))) + (ert-deftest test-org-table/compare () "Basic: Compare field references in Calc." (org-test-table-target-expect -- 2.11.4.GIT