[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tomelr f37841cc78 25/84: test: Add test for TOML Array
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tomelr f37841cc78 25/84: test: Add test for TOML Array of Arrays |
Date: |
Tue, 3 May 2022 09:58:09 -0400 (EDT) |
branch: externals/tomelr
commit f37841cc781ce322ba31806cf9ef1ca7578f5714
Author: Kaushal Modi <kaushal.modi@gmail.com>
Commit: Kaushal Modi <kaushal.modi@gmail.com>
test: Add test for TOML Array of Arrays
---
README.org | 17 ++++++++++++-----
test/tarray.el | 13 ++++++++++++-
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/README.org b/README.org
index 937d0c9462..607ad24589 100644
--- a/README.org
+++ b/README.org
@@ -18,7 +18,7 @@ the Emacs core library
[[https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/j
It will then be gradually refactored so that it meets the
specification defined below.
-* Library Completion Status [3/7]
+* Library Completion Status [4/7]
- [X] Scalar
- [X] Boolean
- [X] Integer
@@ -28,7 +28,7 @@ specification defined below.
- [X] Date + Time with Offset
- [X] Nil
- [X] Arrays
-- [ ] Array of Arrays
+- [X] Array of Arrays
- [ ] Tables
- [ ] Array of Tables
- [ ] Property Lists
@@ -337,16 +337,23 @@ numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]
]
}
#+end_example
-*** Array of Arrays
+*** DONE Array of Arrays
+CLOSED: [2022-04-29 Fri 00:34]
**** S-expression
#+begin_src emacs-lisp :eval no :noweb-ref array-of-arrays
'((nested_arrays_of_ints . [(1 2) (3 4 5)])
(nested_mixed_array . [(1 2) ("a" "b" "c")]))
#+end_src
**** TOML
+#+begin_src emacs-lisp :noweb yes :exports results :wrap src toml
+(tomelr-encode
+ <<array-of-arrays>>)
+#+end_src
+
+#+RESULTS:
#+begin_src toml
-nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ]
-nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ]
+nested_arrays_of_ints = [ [ 1, 2 ], [ 3, 4, 5 ] ]
+nested_mixed_array = [ [ 1, 2 ], [ "a", "b", "c" ] ]
#+end_src
**** JSON Reference
#+begin_src emacs-lisp :noweb yes :exports results
diff --git a/test/tarray.el b/test/tarray.el
index 1c92e55c8c..604855613a 100644
--- a/test/tarray.el
+++ b/test/tarray.el
@@ -24,7 +24,7 @@
;;; Code:
(require 'tomelr)
-;;;; Key with array value
+;;;; Simple arrays
(ert-deftest test-array ()
(let ((inp '(((integers . (1 2 3)))
((integers2 . [1 2 3])) ;Same as above
@@ -39,5 +39,16 @@
(push (tomelr-encode el) out))
(should (equal ref (nreverse out)))))
+;;;; Array of arrays
+(ert-deftest test-array-of-arrays ()
+ (let ((inp '(((nested_arrays_of_ints . [(1 2) (3 4 5)]))
+ ((nested_mixed_array . [(1 2) ("a" "b" "c")]))))
+ (ref '("nested_arrays_of_ints = [ [ 1, 2 ], [ 3, 4, 5 ] ]"
+ "nested_mixed_array = [ [ 1, 2 ], [ \"a\", \"b\", \"c\" ] ]"))
+ out)
+ (dolist (el inp)
+ (push (tomelr-encode el) out))
+ (should (equal ref (nreverse out)))))
+
(provide 'tarray)
- [elpa] externals/tomelr 846676a172 06/84: feat: Add plist example, (continued)
- [elpa] externals/tomelr 846676a172 06/84: feat: Add plist example, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 8bc506af5a 02/84: Add s-exp->toml examples and spec, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 7d8d41f15b 19/84: feat: Encode to multi-line TOML string automatically, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 0ba5f2ff69 24/84: chore(readme): Move mixed type array example to the 'medley' example, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr ca9245038a 35/84: fix: Attempt to make tomelr--toml-table-p more robust, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 000067cf7d 14/84: chore(readme): Update, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 69217d47a6 22/84: feat: Skip converting keys whose values are nil, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr af40c0b40f 11/84: fix: Require subr-x for older Emacs versions, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 060c38b934 16/84: chore(readme): Limit up to 3 levels of headings for Org exports, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 20bf9e6c54 12/84: chore(doc): Add GHA and license badges, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr f37841cc78 25/84: test: Add test for TOML Array of Arrays,
ELPA Syncer <=
- [elpa] externals/tomelr cedb75df72 29/84: feat: Support basic TOML tables, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 91800b26b8 21/84: feat: Recognize RFC 3339 formatted date-time + offset, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 83e924559e 13/84: chore(doc): Fix typo, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 98c9b8c1fc 26/84: fix: Use `=` and `length` separately instead of `length=`, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr c0962ba15f 33/84: fix: Don't run plist to TOML conversion test on emacs 26.3 and older, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 3c068fb9d9 34/84: refactor: Move TOML Table detection logic to a separate fn, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr ad8366d904 36/84: feat: Support basic TOML Table Arrays, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 55fefb0fa8 40/84: doc: Add few links, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 38160ef271 41/84: fix: Stricter condition before starting TOML table array check, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr a7b3a57037 48/84: feat: Make a very basic nested array of TTA work, ELPA Syncer, 2022/05/03