[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tomelr 05d2cafcd9 09/84: test: Add test for boolean sca
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tomelr 05d2cafcd9 09/84: test: Add test for boolean scalar key-value pairs |
Date: |
Tue, 3 May 2022 09:58:07 -0400 (EDT) |
branch: externals/tomelr
commit 05d2cafcd989b977fa3e9d05e293e9f8bae22fc4
Author: Kaushal Modi <kaushal.modi@gmail.com>
Commit: Kaushal Modi <kaushal.modi@gmail.com>
test: Add test for boolean scalar key-value pairs
---
Makefile | 13 +++++++++++++
test/all-tests.el | 24 ++++++++++++++++++++++++
test/tscalar.el | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 79 insertions(+)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..550b82562d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,13 @@
+# Makefile for tomelr.el
+
+EMACS ?= emacs
+
+TEST_DIR=$(shell pwd)/test
+
+# Run all tests by default.
+MATCH ?=
+
+.PHONY: test
+
+test:
+ $(EMACS) --batch -L . -L $(TEST_DIR) -l all-tests.el -eval
'(ert-run-tests-batch-and-exit "$(MATCH)")'
diff --git a/test/all-tests.el b/test/all-tests.el
new file mode 100644
index 0000000000..209d39f3be
--- /dev/null
+++ b/test/all-tests.el
@@ -0,0 +1,24 @@
+;;; all-tests.el --- Tests for tomelr.el -*-
lexical-binding: t; -*-
+
+;; Authors: Kaushal Modi <kaushal.modi@gmail.com>
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(setq load-prefer-newer t)
+
+(require 'tscalar)
diff --git a/test/tscalar.el b/test/tscalar.el
new file mode 100644
index 0000000000..695dfcc4f0
--- /dev/null
+++ b/test/tscalar.el
@@ -0,0 +1,42 @@
+;; -*- lexical-binding: t; -*-
+
+;; Authors: Kaushal Modi <kaushal.modi@gmail.com>
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Test conversion to scalar TOML objects.
+;; https://toml.io/en/v1.0.0#keys
+
+;;; Code:
+(require 'tomelr)
+
+;;;; Scalar - Boolean
+(ert-deftest test-scalar-bool ()
+ (let ((inp '(((bool1 . t))
+ ((bool2 . :false))
+ ((bool3 . "false"))))
+ (ref '("bool1 = true"
+ "bool2 = false"
+ "bool3 = false"))
+ out)
+ (dolist (el inp)
+ (push (tomelr-encode el) out))
+ (should (equal ref (nreverse out)))))
+
+
+(provide 'tscalar)
- [elpa] branch externals/tomelr created (now a1fa47379e), ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 732140041e 07/84: doc: Discover `json-encoding-pretty-print` variable!, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr d96a3b235b 04/84: doc: Add LOGBOOK drawer example, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 05d2cafcd9 09/84: test: Add test for boolean scalar key-value pairs,
ELPA Syncer <=
- [elpa] externals/tomelr 2ea3b5e032 03/84: fix!: Set boolean false using :false value, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 28642f2e78 05/84: fix: dates will be strings in Lisp, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 52dc93201d 08/84: feat: First cut -- Port json-encode from json.el to tomelr-encode, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 7cd15e79b8 10/84: tool(ci): Add GHA setup, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr c872e9efc1 17/84: test: Add test for integer scalar key-value pairs, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr a1f434f03a 31/84: feat: Support nested TOML tables, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 6bbe740e52 28/84: test: Test that 'false is also considered as boolean false in TOML, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 9c91e0dc07 18/84: test: Add test for float scalar key-value pairs, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 96c890a68b 23/84: feat: Convert Lisp lists to TOML arrays, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr bb85106ee9 27/84: doc: Add spec for nested tables and arrays of tables, ELPA Syncer, 2022/05/03