From f4b55ad7774162b0f1080a5c49777499ef7b0b55 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 11 Jan 2020 10:13:30 +0100 Subject: [PATCH] Add tests for NTP time conversion --- site-lisp/db-utils-test.el | 18 ++++++++++++++++++ site-lisp/db-utils.el | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 site-lisp/db-utils-test.el diff --git a/site-lisp/db-utils-test.el b/site-lisp/db-utils-test.el new file mode 100644 index 0000000..c8af144 --- /dev/null +++ b/site-lisp/db-utils-test.el @@ -0,0 +1,18 @@ +;;; db-utils-test.el -- Tests for db-utils -*- lexical-binding: t -*- + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'db-utils) +(require 'cl-lib) + +(ert-deftest db-utils-db/ntp-to-time () + "Test NTP conversion to readable time with `db/ntp-to-time'." + (should (equal (db/ntp-to-time #xdcd2ac0c #x05c6dbac) + "2017-05-26T13:28:44.022565583Z")) + (should (equal (db/ntp-to-time #xbd5927ee #xbc616000) + "2000-08-31T18:52:30.735860824Z"))) + +;;; db-utils-test.el ends here diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 2be47b6..5e271dd 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -227,8 +227,6 @@ FORMAT-STRING defaults to some ISO 8601-like format." (list h l u p) t)))) -;; XXX: add test: dcd2ac0c 05c6dbac is 2017-06-26T13:28:44.022565583Z - (defun conditionally-enable-lispy () "Enable lispy-mode when in `eval-expression’ or in `pp-eval-expression’. lispy must have been loaded for this