Skip to content

Commit

Permalink
fix: Don't run plist to TOML conversion test on emacs 26.3 and older
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Apr 29, 2022
1 parent 2810504 commit c0962ba
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions test/tplist.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,36 @@
;;; Code:
(require 'tomelr)

;; The plist conversion to TOML fails on emacs 26.3 and older
;; versions.
(unless (version< emacs-version "27")
;;;; S-exp objects as plists
(ert-deftest test-plist ()
(let ((inp '((:int 123
:remove_this_key nil
:str "abc"
:bool_false :false
:bool_true t
:int_list (1 2 3)
:str_list ("a" "b" "c")
:bool_list (t :false t :false)
:list_of_lists [(1 2) (3 4 5)]
;; TODO plist specification of TOML tables is not yet supported.
;; :map (:key1 123
;; :key2 "xyz")
)))
(ref '("int = 123
(ert-deftest test-plist ()
(let ((inp '((:int 123
:remove_this_key nil
:str "abc"
:bool_false :false
:bool_true t
:int_list (1 2 3)
:str_list ("a" "b" "c")
:bool_list (t :false t :false)
:list_of_lists [(1 2) (3 4 5)]
;; TODO plist specification of TOML tables is not yet supported.
;; :map (:key1 123
;; :key2 "xyz")
)))
(ref '("int = 123
str = \"abc\"
bool_false = false
bool_true = true
int_list = [ 1, 2, 3 ]
str_list = [ \"a\", \"b\", \"c\" ]
bool_list = [ true, false, true, false ]
list_of_lists = [ [ 1, 2 ], [ 3, 4, 5 ] ]"))
out)
(dolist (el inp)
(push (tomelr-encode el) out))
(should (equal ref (nreverse out)))))
out)
(dolist (el inp)
(push (tomelr-encode el) out))
(should (equal ref (nreverse out))))))


(provide 'tplist)

0 comments on commit c0962ba

Please sign in to comment.