Browse Source

Move a test section around

tags/v0.7.0
Damien Cassou 2 years ago
parent
commit
4d0f4df3fa
No known key found for this signature in database GPG Key ID: A7123815F5DCE914
1 changed files with 42 additions and 42 deletions
  1. +42
    -42
      test/libmpdel-test.el

+ 42
- 42
test/libmpdel-test.el View File

@@ -38,6 +38,48 @@
(should (string-match-p libmpdel--response-regexp "Artist: A-ha\nOK\n")))

;;; Data structures

(ert-deftest libmpdel-artist ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal artist (libmpdel-artist artist)))
(should (equal artist (libmpdel-artist album)))
(should (equal artist (libmpdel-artist song)))))

(ert-deftest libmpdel-artist-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal "The Artist" (libmpdel-artist-name artist)))
(should (equal "The Artist" (libmpdel-artist-name album)))
(should (equal "The Artist" (libmpdel-artist-name song)))))

(ert-deftest libmpdel-album-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should-error (libmpdel-album-name artist))
(should (equal "The Album" (libmpdel-album-name album)))
(should (equal "The Album" (libmpdel-album-name song)))))

(ert-deftest libmpdel-album ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should-error (libmpdel-album artist))
(should (equal album (libmpdel-album album)))
(should (equal album (libmpdel-album song)))))

(ert-deftest libmpdel-entity-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal "The Artist"(libmpdel-entity-name artist)))
(should (equal "The Album" (libmpdel-entity-name album)))
(should (equal "The song" (libmpdel-entity-name song)))))
;;; Helper functions

(ert-deftest libmpdel-extract-data ()
@@ -172,48 +214,6 @@
(should (not (libmpdel-equal song2 song1)))))

;;; Data structures

(ert-deftest libmpdel-artist-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal "The Artist" (libmpdel-artist-name artist)))
(should (equal "The Artist" (libmpdel-artist-name album)))
(should (equal "The Artist" (libmpdel-artist-name song)))))

(ert-deftest libmpdel-artist ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal artist (libmpdel-artist artist)))
(should (equal artist (libmpdel-artist album)))
(should (equal artist (libmpdel-artist song)))))

(ert-deftest libmpdel-album-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should-error (libmpdel-album-name artist))
(should (equal "The Album" (libmpdel-album-name album)))
(should (equal "The Album" (libmpdel-album-name song)))))

(ert-deftest libmpdel-album ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should-error (libmpdel-album artist))
(should (equal album (libmpdel-album album)))
(should (equal album (libmpdel-album song)))))

(ert-deftest libmpdel-entity-name ()
(let* ((artist (libmpdel--artist-create :name "The Artist"))
(album (libmpdel--album-create :name "The Album" :artist artist))
(song (libmpdel--song-create :name "The song" :album album)))
(should (equal "The Artist"(libmpdel-entity-name artist)))
(should (equal "The Album" (libmpdel-entity-name album)))
(should (equal "The song" (libmpdel-entity-name song)))))
;;; Playlist queries

(provide 'libmpel-test)


Loading…
Cancel
Save