From dfef5a4bb5afe6420f92ecaa43759086286285f0 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 4 Apr 2026 15:20:41 -0500 Subject: Remove unused chime--today function Defined and tested but never called from any production code. --- tests/test-chime--today.el | 84 ---------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 tests/test-chime--today.el (limited to 'tests/test-chime--today.el') diff --git a/tests/test-chime--today.el b/tests/test-chime--today.el deleted file mode 100644 index fef81ea..0000000 --- a/tests/test-chime--today.el +++ /dev/null @@ -1,84 +0,0 @@ -;;; test-chime--today.el --- Tests for chime--today -*- lexical-binding: t; -*- - -;; Copyright (C) 2024-2026 Craig Jennings - -;; Author: Craig Jennings - -;; 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 . - -;;; Commentary: - -;; Unit tests for chime--today function. -;; Tests retrieving beginning of current day timestamp. - -;;; Code: - -(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) - -;;; Setup and Teardown - -(defun test-chime--today-setup () - "Setup test environment." - ;; No special setup needed - ) - -(defun test-chime--today-teardown () - "Teardown test environment." - ;; No special teardown needed - ) - -;;; Normal Cases - -(ert-deftest test-chime--today-normal-returns-current-date () - "Test that chime--today returns midnight of current day." - (test-chime--today-setup) - (unwind-protect - (let* ((now (encode-time 30 45 14 8 11 2025)) ; 2025-11-08 14:45:30 - (expected (encode-time 0 0 0 8 11 2025))) ; 2025-11-08 00:00:00 - (cl-letf (((symbol-function 'current-time) (lambda () now))) - (should (equal (chime--today) expected)))) - (test-chime--today-teardown))) - -(ert-deftest test-chime--today-normal-truncates-time-component () - "Test that chime--today zeros out hour/minute/second." - (test-chime--today-setup) - (unwind-protect - (let* ((now (encode-time 59 59 23 8 11 2025)) ; 2025-11-08 23:59:59 - (result (cl-letf (((symbol-function 'current-time) (lambda () now))) - (chime--today))) - (decoded (decode-time result))) - ;; Check that hour, minute, second are all 0 - (should (= 0 (decoded-time-second decoded))) - (should (= 0 (decoded-time-minute decoded))) - (should (= 0 (decoded-time-hour decoded))) - ;; Check date is preserved - (should (= 8 (decoded-time-day decoded))) - (should (= 11 (decoded-time-month decoded))) - (should (= 2025 (decoded-time-year decoded)))) - (test-chime--today-teardown))) - -;;; Boundary Cases - -(ert-deftest test-chime--today-boundary-midnight-returns-correct-day () - "Test that chime--today at midnight returns same day." - (test-chime--today-setup) - (unwind-protect - (let* ((now (encode-time 0 0 0 8 11 2025)) ; Already at midnight - (expected (encode-time 0 0 0 8 11 2025))) - (cl-letf (((symbol-function 'current-time) (lambda () now))) - (should (equal (chime--today) expected)))) - (test-chime--today-teardown))) - -(provide 'test-chime--today) -;;; test-chime--today.el ends here -- cgit v1.2.3