-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b99cb37
commit 7749529
Showing
5 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 👷 Testing | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: containers.common-lisp.net/cl-docker-images/sbcl:latest | ||
|
||
env: | ||
GITHUB_ACTION: true | ||
QUICKLISP_SETUP: /github/home/quicklisp/setup.lisp | ||
GITHUB_WORKSPACE: | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: prepare quicklisp | ||
shell: bash | ||
run: | | ||
install-quicklisp && \ | ||
if [ ! -f ${{ env.QUICKLISP_SETUP }} ]; then \ | ||
echo "Did not find Quicklisp setup file where expected: ${QUICKLISP_SETUP}"; \ | ||
find / -name 'quicklisp' -type d ; \ | ||
fi | ||
- name: test | ||
shell: bash | ||
run: | | ||
./run-tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
sbcl --non-interactive \ | ||
--eval '(ql:quickload :html2clwho/tests)' \ | ||
--eval '(asdf:load-system :html2clwho)' \ | ||
--eval '(uiop:quit (if (html2clwho.test::run-tests) 0 1))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(defpackage :html2clwho.test | ||
(:use :cl :html2clwho :fiveam)) | ||
(in-package :html2clwho.test) | ||
|
||
(def-suite html2clwho-suite :description "Build sexp from html") | ||
(in-suite html2clwho-suite) | ||
|
||
(defun is-html (str sexp) | ||
(is (equal (string-trim '(#\Newline) (html2clwho::build-sexp str)) sexp))) | ||
|
||
(def-test empty-tag () | ||
(is-html "<html></html>" "(:html)")) | ||
|
||
(def-test some-classes () | ||
(is-html "<div class=\"col-md-4\"></div>" "(:div :class \"col-md-4\")")) | ||
|
||
(def-test some-content () | ||
(is-html "<div><span>Hello</span></div>" "(:div | ||
(:span \"Hello\"))")) | ||
|
||
;; https://stackoverflow.com/questions/54889460/asdftest-system-from-a-makefile-doesnt-return-an-error-return-code | ||
(defun run-tests () | ||
(run! 'html2clwho-suite)) |