emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/parseclj 45cd754c32 140/185: Remove parseedn files


From: ELPA Syncer
Subject: [nongnu] elpa/parseclj 45cd754c32 140/185: Remove parseedn files
Date: Tue, 28 Dec 2021 14:05:29 -0500 (EST)

branch: elpa/parseclj
commit 45cd754c32d777acb1d134726b7e3e2c26785ef2
Author: Daniel Barreto <daniel.barreto.n@gmail.com>
Commit: Daniel Barreto <daniel.barreto.n@gmail.com>

    Remove parseedn files
---
 benchmark/speed-comparison.el   |  26 ----
 parseclj-ast.el                 |   1 -
 parseedn.el                     | 188 --------------------------
 test/parseedn-el-parity-test.el | 286 ----------------------------------------
 test/parseedn-test.el           |  77 -----------
 5 files changed, 578 deletions(-)

diff --git a/benchmark/speed-comparison.el b/benchmark/speed-comparison.el
deleted file mode 100644
index 12682112d2..0000000000
--- a/benchmark/speed-comparison.el
+++ /dev/null
@@ -1,26 +0,0 @@
-;; takes a file containing edn file names, one per line
-;;
-;;    locate *.edn > edn.list
-;;
-;; results end up as edn in *edn-parse-time-results*
-(with-current-buffer (find-file-noselect "edn.list")
-  (goto-char 1)
-  (while (and (< (point) (point-max)))
-    (end-of-line)
-    (let* ((fn (buffer-substring-no-properties (line-beginning-position) 
(point)))
-           (buff (find-file-noselect fn))
-           (edn-time 0)
-           (clj-time 0))
-      ;;(message fn)
-      (with-current-buffer buff
-        (let ((start (time-to-seconds (current-time))))
-          (parseedn-read)
-          (setq clj-time (+ clj-time (- (time-to-seconds (current-time)) 
start))))
-        (goto-char 1)
-        (let ((start (time-to-seconds (current-time))))
-          (edn-read)
-          (setq edn-time (+ edn-time (- (time-to-seconds (current-time)) 
start)))))
-      (kill-buffer buff)
-      (when (< (point) (point-max)) (right-char))
-      (with-current-buffer "*edn-parse-time-results*"
-        (insert "{:file \"" fn "\", :edn-time " (number-to-string edn-time) ", 
:clj-time " (number-to-string clj-time) "}\n")))))
diff --git a/parseclj-ast.el b/parseclj-ast.el
index 88a8727a1a..eaab13e5d9 100644
--- a/parseclj-ast.el
+++ b/parseclj-ast.el
@@ -29,7 +29,6 @@
 
 (require 'subr-x)
 (require 'parseclj-lex)
-(require 'parseedn)
 
 ;; AST helper functions
 
diff --git a/parseedn.el b/parseedn.el
deleted file mode 100644
index 9e2e1e915e..0000000000
--- a/parseedn.el
+++ /dev/null
@@ -1,188 +0,0 @@
-;;; parseedn.el --- EDN reader/writer              -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2017-2018  Arne Brasseur
-
-;; Author: Arne Brasseur <arne@arnebrasseur.net>
-
-;; This file is not part of GNU Emacs.
-
-;; This file 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, or (at your option)
-;; any later version.
-
-;; This file 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; The EDN <-> Elisp reader and printer
-
-;;; Code:
-
-;; The EDN spec is not clear about wether \u0123 and \o012 are supported in
-;; strings. They are described as character literals, but not as string escape
-;; codes. In practice all implementations support them (mostly with broken
-;; surrogate pair support), so we do the same. Sorry, emoji 🙁.
-;;
-;; Note that this is kind of broken, we don't correctly detect if \u or \o 
forms
-;; don't have the right forms.
-
-(require 'a)
-(require 'parseclj-parser)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Reader
-
-(defvar parseedn-default-tag-readers
-  (a-list 'inst (lambda (s)
-                  (cl-list* 'edn-inst (date-to-time s)))
-          'uuid (lambda (s)
-                  (list 'edn-uuid s)))
-  "Default reader functions for handling tagged literals in EDN.
-These are the ones defined in the EDN spec, #inst and #uuid.  It
-is not recommended you change this variable, as this globally
-changes the behavior of the EDN reader.  Instead pass your own
-handlers as an optional argument to the reader functions.")
-
-(defun parseedn-reduce-leaf (stack token _options)
-  "Put in the STACK an elisp value representing TOKEN.
-
-OPTIONS is an association list.  See `parseclj-parse' for more information
-on available options."
-  (if (member (parseclj-lex-token-type token) (list :whitespace :comment))
-      stack
-    (cons (parseclj-lex--leaf-token-value token) stack)))
-
-(defun parseedn-reduce-branch (stack opening-token children options)
-  "Reduce STACK with an sequence containing a collection of other elisp values.
-Ignores discard tokens.
-
-OPENING-TOKEN is a lex token representing an opening paren, bracket or
-brace.
-CHILDREN is a collection elisp values to be reduced into an elisp
-sequence.
-OPTIONS is an association list.  See `parseclj-parse' for more information
-on available options."
-  (let ((tag-readers (a-merge parseedn-default-tag-readers (a-get options 
:tag-readers)))
-        (token-type (parseclj-lex-token-type opening-token)))
-    (if (eq token-type :discard)
-        stack
-      (cons
-       (cl-case token-type
-         (:root children)
-         (:lparen children)
-         (:lbracket (apply #'vector children))
-         (:set (list 'edn-set children))
-         (:lbrace (let* ((kvs (seq-partition children 2))
-                         (hash-map (make-hash-table :test 'equal :size (length 
kvs))))
-                    (seq-do (lambda (pair)
-                              (puthash (car pair) (cadr pair) hash-map))
-                            kvs)
-                    hash-map))
-         (:tag (let* ((tag (intern (substring (a-get opening-token :form) 1)))
-                      (reader (a-get tag-readers tag :missing)))
-                 (when (eq :missing reader)
-                   (user-error "No reader for tag #%S in %S" tag (a-keys 
tag-readers)))
-                 (funcall reader (car children)))))
-       stack))))
-
-(defun parseedn-read (&optional tag-readers)
-  "Read content from current buffer and parse it as EDN source.
-Returns an Emacs Lisp value.
-
-TAG-READERS is an optional association list where keys are symbols
-identifying *tags*, and values are tag handler functions that receive one
-argument: *the tagged element*, and specify how to interpret it."
-  (parseclj-parser #'parseedn-reduce-leaf
-                   #'parseedn-reduce-branch
-                   (a-list :tag-readers tag-readers)))
-
-(defun parseedn-read-str (s &optional tag-readers)
-  "Parse string S as EDN.
-Returns an Emacs Lisp value.
-
-TAG-READERS is an optional association list.  For more information, see
-`parseedn-read'."
-  (with-temp-buffer
-    (insert s)
-    (goto-char 1)
-    (car (parseedn-read tag-readers))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Printer
-
-(defun parseedn-print-seq (coll)
-  "Insert sequence COLL as EDN into the current buffer."
-  (parseedn-print (elt coll 0))
-  (let ((next (seq-drop coll 1)))
-    (when (not (seq-empty-p next))
-      (insert " ")
-      (parseedn-print-seq next))))
-
-(defun parseedn-print-kvs (map)
-  "Insert hash table MAP as an EDN map into the current buffer."
-  (let ((keys (a-keys map)))
-    (parseedn-print (car keys))
-    (insert " ")
-    (parseedn-print (a-get map (car keys)))
-    (let ((next (cdr keys)))
-      (when (not (seq-empty-p next))
-        (insert ", ")
-        (parseedn-print-kvs next)))))
-
-(defun parseedn-print (datum)
-  "Insert DATUM as EDN into the current buffer.
-DATUM can be any Emacs Lisp value."
-  (cond
-   ((or (null datum) (numberp datum))
-    (prin1 datum (current-buffer)))
-
-   ((stringp datum)
-    (insert "\"")
-    (seq-doseq (char datum)
-      (insert (cl-case char
-                (?\t "\\t")
-                (?\f "\\f")
-                (?\" "\\\"")
-                (?\r "\\r")
-                (?\n"foo\t" "\\n")
-                (?\\ "\\\\")
-                (t (char-to-string char)))))
-    (insert "\""))
-
-   ((eq t datum)
-    (insert "true"))
-
-   ((symbolp datum)
-    (insert (symbol-name datum)))
-
-   ((vectorp datum) (insert "[") (parseedn-print-seq datum) (insert "]"))
-
-   ((consp datum)
-    (cond
-     ((eq 'edn-set (car datum))
-      (insert "#{") (parseedn-print-seq (cadr datum)) (insert "}"))
-     (t (insert "(") (parseedn-print-seq datum) (insert ")"))))
-
-   ((hash-table-p datum)
-    (insert "{") (parseedn-print-kvs datum) (insert "}"))))
-
-(defun parseedn-print-str (datum)
-  "Return a string containing DATUM as EDN.
-DATUM can be any Emacs Lisp value."
-  (with-temp-buffer
-    (parseedn-print datum)
-    (buffer-substring-no-properties (point-min) (point-max))))
-
-(provide 'parseedn)
-
-;;; parseedn.el ends here
diff --git a/test/parseedn-el-parity-test.el b/test/parseedn-el-parity-test.el
deleted file mode 100644
index c58641a4f3..0000000000
--- a/test/parseedn-el-parity-test.el
+++ /dev/null
@@ -1,286 +0,0 @@
-;;; edn-el-parity.el --- Tests from edn.el
-
-;; Author: Lars Andersen <expez@expez.com>, Arne Brasseur 
<arne@arnebrasseur.net>
-
-;; Copyright (C) 2015  Lars Andersen
-
-;; This file is not part of GNU Emacs.
-
-;; This file 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, or (at your option)
-;; any later version.
-
-;; This file 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; These tests are copied verbatim from the edn.el source, and adapted to use
-;; our API. This way we assure that parseclj can act as a drop-in replacement
-;; for edn.el.
-
-;;; Code:
-
-(require 'ert)
-(require 'parseclj)
-(eval-when-compile (require 'subr-x)) ;; for things like hash-table-keys
-
-(ert-deftest whitespace ()
-  (should (null (parseedn-read-str "")))
-  (should (null (parseedn-read-str " ")))
-  (should (null (parseedn-read-str "   ")))
-  (should (null (parseedn-read-str "   ")))
-  (should (null (parseedn-read-str "           ")))
-  (should (null (parseedn-read-str ",")))
-  (should (null (parseedn-read-str ",,,,")))
-  (should (null (parseedn-read-str "     , ,\n")))
-  (should (null (parseedn-read-str "\n ,,      ")))
-  (should (equal [a b c d] (parseedn-read-str "[a ,,,,,, b,,,,,c ,d]"))))
-
-(ert-deftest symbols ()
-  :tags '(edn symbol)
-  (should (equal 'foo (parseedn-read-str "foo")))
-  (should (equal 'foo\. (parseedn-read-str "foo.")))
-  (should (equal '%foo\. (parseedn-read-str "%foo.")))
-  (should (equal 'foo/bar (parseedn-read-str "foo/bar")))
-  (equal 'some\#sort\#of\#symbol (parseedn-read-str "some#sort#of#symbol"))
-  (equal 'truefalse (parseedn-read-str "truefalse"))
-  (equal 'true. (parseedn-read-str "true."))
-  (equal '/ (parseedn-read-str "/"))
-  (should (equal '.true (parseedn-read-str ".true")))
-  (should (equal 'some:sort:of:symbol (parseedn-read-str 
"some:sort:of:symbol")))
-  (equal 'foo-bar (parseedn-read-str "foo-bar"))
-  (should (equal '+some-symbol (parseedn-read-str "+some-symbol")))
-  (should (equal '-symbol (parseedn-read-str "-symbol"))))
-
-(ert-deftest booleans ()
-  :tags '(edn boolean)
-  (should (equal t (parseedn-read-str "true")))
-  (should (equal nil (parseedn-read-str "false "))))
-
-(ert-deftest characters ()
-  :tags '(edn characters)
-  (should (equal 97 (parseedn-read-str "\\a")))
-  (should (equal 960 (parseedn-read-str "\\u03C0")))
-  ;;(should (equal 'newline (parseedn-read-str "\\newline")))
-  )
-
-(ert-deftest elision ()
-  :tags '(edn elision)
-  (should-not (parseedn-read-str "#_foo"))
-  (should-not (parseedn-read-str "#_ 123"))
-  (should-not (parseedn-read-str "#_:foo"))
-  (should-not (parseedn-read-str "#_ \\a"))
-  (should-not (parseedn-read-str "#_
-\"foo\""))
-  (should-not (parseedn-read-str "#_ (1 2 3)"))
-  (should (equal '(1 3) (parseedn-read-str "(1 #_ 2 3)")))
-  (should (equal '[1 2 3 4] (parseedn-read-str "[1 2 #_[4 5 6] 3 4]")))
-  (should (map-equal (make-seeded-hash-table :foo :bar)
-                     (parseedn-read-str "{:foo #_elided :bar}")))
-  (should (equal '(edn-set (1 2 3 4))
-                 (parseedn-read-str "#{1 2 #_[1 2 3] 3 #_ (1 2) 4}")))
-  (should (equal [a d] (parseedn-read-str "[a #_ ;we are discarding what comes 
next
- c d]"))))
-
-(ert-deftest string ()
-  :tags '(edn string)
-  (should (equal "this is a string" (parseedn-read-str "\"this is a 
string\"")))
-  (should (equal "this has an escaped \"quote in it"
-                 (parseedn-read-str "\"this has an escaped \\\"quote in 
it\"")))
-  (should (equal "foo\tbar" (parseedn-read-str "\"foo\\tbar\"")))
-  (should (equal "foo\nbar" (parseedn-read-str "\"foo\\nbar\"")))
-  (should (equal "this is a string \\ that has an escaped backslash"
-                 (parseedn-read-str "\"this is a string \\\\ that has an 
escaped backslash\"")))
-  (should (equal "[" (parseedn-read-str "\"[\""))))
-
-(ert-deftest keywords ()
-  :tags '(edn keywords)
-  (should (equal :namespace\.of\.some\.length/keyword-name
-                 (parseedn-read-str ":namespace.of.some.length/keyword-name")))
-  (should (equal :\#/\# (parseedn-read-str ":#/#")))
-  (should (equal :\#/:a (parseedn-read-str ":#/:a")))
-  (should (equal :\#foo (parseedn-read-str ":#foo"))))
-
-(ert-deftest integers ()
-  :tags '(edn integers)
-  (should (= 0 (parseedn-read-str "0")))
-  (should (= 0 (parseedn-read-str "+0")))
-  (should (= 0 (parseedn-read-str "-0")))
-  (should (= 100 (parseedn-read-str "100")))
-  (should (= -100 (parseedn-read-str "-100"))))
-
-(ert-deftest floats ()
-  :tags '(edn floats)
-  (should (= 12.32 (parseedn-read-str "12.32")))
-  (should (= -12.32 (parseedn-read-str "-12.32")))
-  (should (= 9923.23 (parseedn-read-str "+9923.23")))
-  (should (= 4.5e+044 (parseedn-read-str "45e+43")))
-  (should (= -4.5e-042 (parseedn-read-str "-45e-43")))
-  (should (= 4.5e+044 (parseedn-read-str "45E+43"))))
-
-(ert-deftest lists ()
-  :tags '(edn lists)
-  (should-not (parseedn-read-str "()"))
-  (should (equal '(1 2 3) (parseedn-read-str "( 1 2 3)")))
-  (should (equal '(12.1 ?a foo :bar) (parseedn-read-str "(12.1 \\a foo 
:bar)")))
-  (should (equal '((:foo bar :bar 12)) (parseedn-read-str "( (:foo bar :bar 
12))")))
-  (should (equal
-           '(defproject com\.thortech/data\.edn "0.1.0-SNAPSHOT")
-           (parseedn-read-str "(defproject com.thortech/data.edn 
\"0.1.0-SNAPSHOT\")"))))
-
-(ert-deftest vectors ()
-  :tags '(edn vectors)
-  (should (equal [] (parseedn-read-str "[]")))
-  (should (equal [] (parseedn-read-str "[ ]")))
-  (should (equal '[1 2 3] (parseedn-read-str "[ 1 2 3 ]")))
-  (should (equal '[12.1 ?a foo :bar] (parseedn-read-str "[ 12.1 \\a foo 
:bar]")))
-  (should (equal '[[:foo bar :bar 12]] (parseedn-read-str "[[:foo bar :bar 
12]]")))
-  (should (equal '[( :foo bar :bar 12 ) "foo"]
-                 (parseedn-read-str "[(:foo bar :bar 12) \"foo\"]")))
-  (should (equal '[/ \. * ! _ \? $ % & = - +]
-                 (parseedn-read-str "[/ . * ! _ ? $ % & = - +]")))
-  (should (equal
-           ;;[99 newline return space tab]
-           [99 10 13 32 9]
-           (parseedn-read-str "[\\c \\newline \\return \\space \\tab]"))))
-
-(defun map-equal (m1 m2)
-  (and (and (hash-table-p m1) (hash-table-p m2))
-       (eq (hash-table-test m1) (hash-table-test m2))
-       (= (hash-table-count m1) (hash-table-count m2))
-       (equal (hash-table-keys m1) (hash-table-keys m2))
-       (equal (hash-table-values m1) (hash-table-values m2))))
-
-(defun make-seeded-hash-table (&rest keys-and-values)
-  (let ((m (make-hash-table :test #'equal)))
-    (while keys-and-values
-      (puthash (pop keys-and-values) (pop keys-and-values) m))
-    m))
-
-(ert-deftest maps ()
-  :tags '(edn maps)
-  (should (hash-table-p (parseedn-read-str "{ }")))
-  (should (hash-table-p (parseedn-read-str "{}")))
-  (should (map-equal (make-seeded-hash-table :foo :bar :baz :qux)
-                     (parseedn-read-str "{ :foo :bar :baz :qux}")))
-  (should (map-equal (make-seeded-hash-table 1 "123" 'vector [1 2 3])
-                     (parseedn-read-str "{ 1 \"123\" vector [1 2 3]}")))
-  (should (map-equal (make-seeded-hash-table [1 2 3] "some numbers")
-                     (parseedn-read-str "{[1 2 3] \"some numbers\"}"))))
-
-(ert-deftest sets ()
-  :tags '(edn sets)
-  (should (eq 'edn-set (car (parseedn-read-str "#{}"))))
-  (should (eq 'edn-set (car (parseedn-read-str "#{ }"))))
-  (should (equal '(edn-set (1 2 3)) (parseedn-read-str "#{1 2 3}")))
-  (should (equal '(edn-set (1 [1 2 3] 3)) (parseedn-read-str "#{1 [1 2 3] 
3}"))))
-
-(ert-deftest comment ()
-  :tags '(edn comments)
-  (should-not (parseedn-read-str ";nada"))
-  (should (equal 1 (parseedn-read-str ";; comment
-1")))
-  (should (equal [1 2 3] (parseedn-read-str "[1 2 ;comment to eol
-3]")))
-  (should (equal '[valid more items] (parseedn-read-str "[valid;touching 
trailing comment
- more items]")))
-  (should (equal [valid vector more vector items] (parseedn-read-str "[valid 
vector
- ;;comment in vector
- more vector items]"))))
-
-(defun test-val-passed-to-handler (val)
-  (should (listp val))
-  (should (= (length val) 2))
-  (should (= 1 (car val)))
-  1)
-
-(setq parseedn-test-extra-handlers
-      (a-list
-       'my/type #'test-val-passed-to-handler
-       'my/other-type (lambda (val) 2)))
-
-(ert-deftest tags ()
-  :tags '(edn tags)
-  (should-error (parseedn-read-str "#my/type value" 
parseedn-test-extra-handlers))
-  (should (= 1 (parseedn-read-str "#my/type (1 2)" 
parseedn-test-extra-handlers)))
-  (should (= 2 (parseedn-read-str "#my/other-type {:foo :bar}" 
parseedn-test-extra-handlers)))
-  (should-error (parseedn-read-str "#myapp/Person {:first \"Fred\" :last 
\"Mertz\"}")))
-
-(ert-deftest roundtrip ()
-  :tags '(edn roundtrip)
-  (let ((data [1 2 3 :foo (4 5) qux "quux"]))
-    (should (equal data (parseedn-read-str (parseedn-print-str data))))
-    (should (map-equal (make-seeded-hash-table :foo :bar)
-                       (parseedn-read-str (parseedn-print-str 
(make-seeded-hash-table :foo :bar)))))
-    (should (equal '(edn-set (1 2 3 [3 1.11]))
-                   (parseedn-read-str (parseedn-print-str '(edn-set (1 2 3 [3 
1.11]))))))))
-
-(ert-deftest inst ()
-  :tags '(edn inst)
-  (let* ((inst-str "#inst \"1985-04-12T23:20:50.52Z\"")
-         (inst (parseedn-read-str inst-str))
-         (time (date-to-time "1985-04-12T23:20:50.52Z")))
-    (should (eq 'edn-inst (car inst)))
-    (should (equal time (cdr inst)))))
-
-(ert-deftest uuid ()
-  :tags '(edn uuid)
-  (let* ((str "f81d4fae-7dec-11d0-a765-00a0c91e6bf6")
-         (uuid (parseedn-read-str (concat "#uuid \"" str "\""))))
-    (should (eq 'edn-uuid (car uuid)))))
-
-;; (ert-deftest invalid-edn ()
-;;   (should-error (parseedn-read-str "///"))
-;;   (should-error (parseedn-read-str "~cat"))
-;;   (should-error (parseedn-read-str "foo/bar/baz/qux/quux"))
-;;   (should-error (parseedn-read-str "#foo/"))
-;;   (should-error (parseedn-read-str "foo/"))
-;;   (should-error (parseedn-read-str ":foo/"))
-;;   (should-error (parseedn-read-str "#/foo"))
-;;   (should-error (parseedn-read-str "/symbol"))
-;;   (should-error (parseedn-read-str ":/foo"))
-;;   (should-error (parseedn-read-str "+5symbol"))
-;;   (should-error (parseedn-read-str ".\\newline"))
-;;   (should-error (parseedn-read-str "0cat"))
-;;   (should-error (parseedn-read-str "-4cats"))
-;;   (should-error (parseedn-read-str ".9"))
-;;   (should-error (parseedn-read-str ":keyword/with/too/many/slashes"))
-;;   (should-error (parseedn-read-str ":a.b.c/"))
-;;   (should-error (parseedn-read-str "\\itstoolong"))
-;;   (should-error (parseedn-read-str ":#/:"))
-;;   (should-error (parseedn-read-str "/foo//"))
-;;   (should-error (parseedn-read-str "///foo"))
-;;   (should-error (parseedn-read-str ":{}"))
-;;   (should-error (parseedn-read-str "//"))
-;;   (should-error (parseedn-read-str "##"))
-;;   (should-error (parseedn-read-str "::"))
-;;   (should-error (parseedn-read-str "::a"))
-;;   (should-error (parseedn-read-str ".5symbol"))
-;;   (should-error (parseedn-read-str "{ \"foo\""))
-;;   (should-error (parseedn-read-str "{ \"foo\" :bar"))
-;;   (should-error (parseedn-read-str "{"))
-;;   (should-error (parseedn-read-str ":{"))
-;;   (should-error (parseedn-read-str "{{"))
-;;   (should-error (parseedn-read-str "}"))
-;;   (should-error (parseedn-read-str ":}"))
-;;   (should-error (parseedn-read-str "}}"))
-;;   (should-error (parseedn-read-str "#:foo"))
-;;   (should-error (parseedn-read-str "\\newline."))
-;;   (should-error (parseedn-read-str "\\newline0.1"))
-;;   (should-error (parseedn-read-str "^"))
-;;   (should-error (parseedn-read-str ":^"))
-;;   (should-error (parseedn-read-str "_:^"))
-;;   (should-error (parseedn-read-str "#{{[}}"))
-;;   (should-error (parseedn-read-str "[}"))
-;;   (should-error (parseedn-read-str "@cat")))
-
-;;; edn-el-parity-test.el ends here
diff --git a/test/parseedn-test.el b/test/parseedn-test.el
deleted file mode 100644
index eb4cfb41fa..0000000000
--- a/test/parseedn-test.el
+++ /dev/null
@@ -1,77 +0,0 @@
-;;; parseedn-test.el --- Unit tests for EDN reading/printing
-
-;; Copyright (C) 2017-2018  Arne Brasseur
-
-;; Author: Arne Brasseur <arne@arnebrasseur.net>
-
-;; This file is not part of GNU Emacs.
-
-;; This file 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, or (at your option)
-;; any later version.
-
-;; This file 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 GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary
-
-;; Unit tests for EDN reading/printing
-
-;;; Code
-
-(require 'ert)
-(require 'parseclj)
-
-(load "test/parseclj-test-data.el")
-
-(ert-deftest parseedn-print-test ()
-  (should (equal (parseedn-print-str nil) "nil"))
-  (should (equal (parseedn-print-str 100) "100"))
-  (should (equal (parseedn-print-str 1.2) "1.2"))
-  (should (equal (parseedn-print-str [1 2 3]) "[1 2 3]"))
-  (should (equal (parseedn-print-str t) "true")))
-
-(ert-deftest parseedn-read-test ()
-  (should (equal (parseedn-read-str "true") t)))
-
-(defmacro define-parseedn-read-tests ()
-  `(progn
-     ,@(mapcar
-        (lambda (pair)
-          (let ((name (car pair))
-                (data (cdr pair)))
-            (if (and (a-get data :edn) (a-get data :source))
-                (let ((test-name (intern (concat "parseedn-read:" name))))
-                  `(ert-deftest ,test-name ()
-                     :tags '(parseedn)
-                     (with-temp-buffer
-                       (insert ,(a-get data :source))
-                       (goto-char 1)
-                       (should (a-equal (parseedn-read) ',(a-get data 
:edn)))))))))
-        parseclj-test-data)))
-
-(defmacro define-parseedn-roundtrip-tests ()
-  `(progn
-     ,@(mapcar
-        (lambda (pair)
-          (let ((name (car pair))
-                (data (cdr pair)))
-            (if (and (a-get data :edn) (a-get data :source) (member 
:edn-roundtrip (a-get data :tags)))
-                (let ((test-name (intern (concat "parseedn-rountrip:" name))))
-                  `(ert-deftest ,test-name ()
-                     :tags '(parseedn-rountrip)
-                     (should (equal (parseedn-print-str (car ',(a-get data 
:edn))) ,(a-get data :source))))))))
-        parseclj-test-data)))
-
-(define-parseedn-read-tests)
-(define-parseedn-roundtrip-tests)
-
-;;; parseedn-test.el



reply via email to

[Prev in Thread] Current Thread [Next in Thread]