Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
md-arif-shaikh committed Apr 3, 2024
1 parent 2882c1c commit 8f425cd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/emacs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Emacs Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Emacs
run: sudo apt-get install emacs

- name: Run tests
run: emacs --batch -l ert -l tzc-tests.el -f ert-run-tests-batch-and-exit
9 changes: 9 additions & 0 deletions tzc-tests.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(require 'ert)
(load-file "tzc.el")

(ert-deftest tzc-test-get-offset-lisbon ()
(should (equal (mapcar (lambda (date) (tzc--get-offset "Europe/Lisbon" date)) (list "2024-03-25" "2024-04-05")) (list "+0000" "+0100"))))

(ert-deftest tzc-test-get-offset-los-angeles ()
(should (equal (mapcar (lambda (date) (tzc--get-offset "America/Los_Angeles" date)) (list "2024-02-25" "2024-03-15")) (list "-0800" "-0700"))))

0 comments on commit 8f425cd

Please sign in to comment.