-
Notifications
You must be signed in to change notification settings - Fork 128
Add unit test and github actions configuration #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tests good, please merge it. |
test/yaml-mode-test.el
Outdated
@@ -0,0 +1,117 @@ | |||
;;;; yaml-mode-test.el --- Tests for yaml-mode -*- lexical-binding: t; -*- | |||
|
|||
;; Copyright (C) 2010-2022 Yoshiki Kurihara |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, you wrote the file, so you have the copyright and authorship.
test/yaml-mode-test.el
Outdated
|
||
(require 'yaml-mode) | ||
(require 'ert) | ||
(require 'cl-lib) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import.
test/yaml-mode-test.el
Outdated
;; for version < 25 | ||
(defconst yaml-test-font-lock-function | ||
(if (fboundp 'font-lock-ensure) | ||
#'font-lock-ensure #'font-lock-fontify-buffer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either put the whole if
expression on one line or every branch on a line.
test/yaml-mode-test.el
Outdated
(if (fboundp 'font-lock-ensure) | ||
#'font-lock-ensure #'font-lock-fontify-buffer)) | ||
|
||
(defmacro yaml-test-string-mode (mode string &rest body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a premature abstraction. Since only yaml-mode is tested, both macros can be combined into one:
- Change the
(funcall ,mode)
line to(yaml-mode)
- Rename this macro to
yaml-test-string
- Delete the other macro
yaml-mode.el
Outdated
@@ -178,7 +178,7 @@ that key is pressed to begin a block literal." | |||
"y" "Y" "yes" "Yes" "YES" "n" "N" "no" "No" "NO" | |||
"true" "True" "TRUE" "false" "False" "FALSE" | |||
"on" "On" "ON" "off" "Off" "OFF") t) | |||
" *$") | |||
"\\b") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested some more meanwhile and it does match True#123
which it shouldn't. So \\_>
is better.
Generally speaking, I'm in for automating these checks. What do you think of using an existing solution for testing the font-lock bits, like using assess-face-at= from assess or faceup? |
.github/workflows/ci.yml
Outdated
|
||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: sudo apt install pandoc aspell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pandoc and aspell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is wrong copy and paste, I'll fix later
test/yaml-mode-test.el
Outdated
@@ -1,6 +1,6 @@ | |||
;;;; yaml-mode-test.el --- Tests for yaml-mode -*- lexical-binding: t; -*- | |||
|
|||
;; Copyright (C) 2010-2022 Yoshiki Kurihara | |||
;; Copyright (C) 2022 - Shohei YOSHIDA | |||
|
|||
;; Author: Yoshiki Kurihara <clouder@gmail.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright and author are mismatched
@wasamasa I've fixed your comments |
I have never use such tools and I have never seen projects that use those frameworks, sorry. |
Thank you for reviewing |
Changing
This patch took #98 changes for adding unit test
CC: @liuyinz