[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 09aa49c6b0 065/472: UTs for pacman-image. Close #5
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 09aa49c6b0 065/472: UTs for pacman-image. Close #52 |
Date: |
Thu, 6 Jan 2022 21:59:13 -0500 (EST) |
branch: elpa/pacmacs
commit 09aa49c6b068276b4cd12adbd0461731c049f1b7
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
UTs for pacman-image. Close #52
---
test/pacman-anim-test.el | 4 ----
test/pacman-image-test.el | 42 ++++++++++++++++++++++++++++++++++++++++++
test/test-helper.el | 3 +++
3 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/test/pacman-anim-test.el b/test/pacman-anim-test.el
index c69c007fbf..09ea407a75 100644
--- a/test/pacman-anim-test.el
+++ b/test/pacman-anim-test.el
@@ -1,7 +1,3 @@
-(require 'cl) ;el-mock doesn't work without
- ;this
-(require 'json)
-
(ert-deftest pacman-make-anim-test ()
(should (equal (list :frames (list 1 2 3 4 5)
:current-frame 0
diff --git a/test/pacman-image-test.el b/test/pacman-image-test.el
new file mode 100644
index 0000000000..829ee061c3
--- /dev/null
+++ b/test/pacman-image-test.el
@@ -0,0 +1,42 @@
+(ert-deftest pacman-load-image-test ()
+ (let ((default-directory "/khooy/"))
+ (with-mock
+ (mock (create-image "/khooy/pew" 'xpm nil :heuristic-mask t) => 42 :times
1)
+ (should (= 42 (pacman-load-image "pew"))))))
+
+(ert-deftest pacman-insert-image-test ()
+ (let ((resource "khooy")
+ (resource-vector "pew"))
+ (with-mock
+ (mock (insert-image resource " " nil resource-vector) => 42 :times 1)
+ (should (= 42 (pacman-insert-image resource resource-vector))))))
+
+(ert-deftest pacman-create-color-block-test ()
+ (let ((width 10)
+ (height 20)
+ (color "red")
+ (bool-vector-result 42)
+ (make-vector-result 43)
+ (create-image-result 44))
+ (with-mock
+ (mock (make-bool-vector height t) => bool-vector-result :times 1)
+ (mock (make-vector width bool-vector-result 'xbm t
+ :width width :height height
+ :foreground color) => make-vector-result :times 1)
+ (mock (create-image make-vector-result) => create-image-result :times 1)
+ (should (equal create-image-result
+ (pacman-create-color-block width height color))))))
+
+(ert-deftest pacman-create-transparent-block ()
+ (let ((width 10)
+ (height 20)
+ (bool-vector-result 42)
+ (make-vector-result 43)
+ (create-image-result 44))
+ (with-mock
+ (mock (make-bool-vector height nil) => bool-vector-result :times 1)
+ (mock (make-vector width bool-vector-result 'xbm t
+ :width width :height height) => make-vector-result
:times 1)
+ (mock (create-image make-vector-result) => create-image-result :times 1)
+ (should (equal create-image-result
+ (pacman-create-transparent-block width height))))))
diff --git a/test/test-helper.el b/test/test-helper.el
index 5bbb97b706..3cf0400ea4 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -1,3 +1,5 @@
+(require 'cl) ;el-mock doesn't work without
+ ;this
(require 'el-mock)
(require 'undercover)
@@ -5,3 +7,4 @@
(add-to-list 'load-path ".")
(load "pacman-anim.el")
+(load "pacman-image.el")
- [nongnu] elpa/pacmacs 93f031ae4e 382/472: Fix create-wall-tile UT (#138), (continued)
- [nongnu] elpa/pacmacs 93f031ae4e 382/472: Fix create-wall-tile UT (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2c7e23070b 380/472: Fix put-vertical-bar UT (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs dc14097468 400/472: Add emacs mode for game over (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 98816141d5 398/472: Merge pull request #189 from codingteam/remove-make-terrified-ghost, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 30442797d3 404/472: Add consts for nick and table sizes (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0eeb82ebc9 425/472: Merge pull request #193 from codingteam/rework-nick-after-death-134, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ce1054fab3 433/472: Remove redundant find-resource-file call (#191), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 21a99294ad 440/472: Add score sign (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9fd3009e5a 442/472: Merge pull request #206 from codingteam/bug/quit-game-over-with-q-202, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 95cce606fd 024/472: Support for Aseprite animation format. Close #16, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 09aa49c6b0 065/472: UTs for pacman-image. Close #52,
ELPA Syncer <=
- [nongnu] elpa/pacmacs ee893d28bd 180/472: Add module for recording action (#115), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 95c046205a 187/472: Compilation warnings as errors (#123), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fe40eb20c7 190/472: Merge branch 'coverage-dropped-124' (#124), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8e36b66a6f 199/472: Make object-board contain list of object (#126), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 6b43cde65d 223/472: Add big pill game object (#81), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0546e964b1 222/472: Connected walls proof of concept for #131, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 19ffa64f7e 230/472: Merge branch 'master' into connecte-walls, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e0856fc881 244/472: Refactor wall tiles functions (#131):, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 79aa80e1d2 245/472: Merge branch 'connecte-walls'. Close #131, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2b9811e71b 246/472: Add README for tools, ELPA Syncer, 2022/01/06