emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/emms 2852a8f61b 10/42: Add tests for emms-info-native


From: ELPA Syncer
Subject: [elpa] externals/emms 2852a8f61b 10/42: Add tests for emms-info-native
Date: Wed, 1 Nov 2023 15:57:59 -0400 (EDT)

branch: externals/emms
commit 2852a8f61b82e8263b5ce24151ee033087110b2e
Author: Petteri Hintsanen <petterih@iki.fi>
Commit: Petteri Hintsanen <petterih@iki.fi>

    Add tests for emms-info-native
    
    These use test data from Mutagen project.
---
 test/emms-info-native-tests.el              | 117 ++++++++++++++++++++++++++++
 test/resources/52-overwritten-metadata.flac | Bin 0 -> 512 bytes
 test/resources/flac_application.flac        | Bin 0 -> 13000 bytes
 test/resources/id3v22-test.mp3              | Bin 0 -> 5120 bytes
 test/resources/multipage-setup.ogg          | Bin 0 -> 76983 bytes
 test/resources/silence-44-s.flac            | Bin 0 -> 50904 bytes
 test/resources/silence-44-s.mp3             | Bin 0 -> 16384 bytes
 test/resources/variable-block.flac          | Bin 0 -> 10240 bytes
 test/resources/vbri.mp3                     | Bin 0 -> 8192 bytes
 9 files changed, 117 insertions(+)

diff --git a/test/emms-info-native-tests.el b/test/emms-info-native-tests.el
new file mode 100644
index 0000000000..3da5785042
--- /dev/null
+++ b/test/emms-info-native-tests.el
@@ -0,0 +1,117 @@
+;;; emms-info-native-tests.el --- Test suite for emms-info-native  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2023 Free Software Foundation, Inc.
+
+;; Author: Petteri Hintsanen <petterih@iki.fi>
+
+;; This file is part of EMMS.
+
+;; EMMS is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; EMMS is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+;; License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with EMMS; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+;; MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; This test suite exercises `emms-info-native' with various input
+;; files.
+
+;;; Code:
+
+(require 'emms-info-native)
+(require 'ert)
+(require 'ert-x)
+
+(ert-deftest emms-info-native-test-mp3 ()
+  (should (equal (emms-info-native--decode-info-fields
+                  (ert-resource-file "id3v22-test.mp3"))
+                 '(("year" . "2004")
+                   ("tracknumber" . "3/11")
+                   ("album" . "Hymns for the Exiled")
+                   ("artist" . "Anais Mitchell")
+                   ("title" . "cosmic american")
+                   ("playing-time" . 0))))
+  
+  (should (equal (emms-info-native--decode-info-fields
+                  (ert-resource-file "silence-44-s.mp3"))
+                 '(("tracknumber" . "02/10")
+                   ("title" . "Silence")
+                   ("artist" . "jzig")
+                   ("artist" . "piman")
+                   ("album" . "Quod Libet Test Data")
+                   ("genre" . "Silence")
+                   ("year" . "2004")
+                   ("playing-time" . 4))))
+
+  (should (equal (emms-info-native--decode-info-fields
+                  (ert-resource-file "vbri.mp3"))
+                 '(("title" . "I Can Walk On Water I Can Fly")
+                   ("artist" . "Basshunter")
+                   ("album" . "I Can Walk On Water I Can Fly")
+                   ("year" . "2007")
+                   ("genre" . "Dance")
+                   ("composer")
+                   ("tracknumber" . "01")
+                   ("playing-time" . 222)))))
+
+(ert-deftest emms-info-native-test-ogg ()
+  (should (equal (emms-info-native--decode-info-fields
+                  (ert-resource-file "multipage-setup.ogg"))
+                 '(("artist" . "UVERworld")
+                   ("genre" . "JRock")
+                   ("title" . "Burst")
+                   ("album" . "Timeless")
+                   ("tracknumber" . "7")
+                   ("date" . "2006")
+                   ("playing-time" . 4)))))
+
+  (ert-deftest emms-info-native-test-flac ()
+    (should (equal (emms-info-native--decode-info-fields
+                    (ert-resource-file "52-overwritten-metadata.flac"))
+                   '(("tracknumber" . "01")
+                     ("date" . "1990")
+                     ("genre" . "Klezmer")
+                     ("album" . "The Magic of the Klezmer")
+                     ("artist" . "Giora Feidman")
+                     ("title" . "Songs of Rejoicing")
+                     ("playing-time" . 236))))
+    (should (equal (emms-info-native--decode-info-fields
+                    (ert-resource-file "flac_application.flac"))
+                   '(("artistsort" . "Belle and Sebastian")
+                     ("artist" . "Belle and Sebastian")
+                     ("title" . "I Want the World to Stop")
+                     ("album" . "Belle and Sebastian Write About Love")
+                     ("tracknumber" . "4/11")
+                     ("date" . "2010-10-11")
+                     ("playing-time" . 273))))
+    (should (equal (emms-info-native--decode-info-fields
+                    (ert-resource-file "silence-44-s.flac"))
+                   '(("title" . "Silence")
+                     ("date" . "2004")
+                     ("tracknumber" . "02/10")
+                     ("genre" . "Silence")
+                     ("artist" . "jzig")
+                     ("artist" . "piman")
+                     ("album" . "Quod Libet Test Data")
+                     ("playing-time" . 3))))
+    (should (equal (emms-info-native--decode-info-fields
+                    (ert-resource-file "variable-block.flac"))
+                   '(("tracknumber" . "01")
+                     ("title" . "DIVE FOR YOU")
+                     ("genre" . "Anime Soundtrack")
+                     ("discnumber" . "1")
+                     ("date" . "2004")
+                     ("composer" . "Boom Boom Satellites (Lyrics)")
+                     ("artist" . "Boom Boom Satellites")
+                     ("album" . "Appleseed Original Soundtrack")
+                     ("playing-time" . 261)))))
diff --git a/test/resources/52-overwritten-metadata.flac 
b/test/resources/52-overwritten-metadata.flac
new file mode 100644
index 0000000000..7f5dea001c
Binary files /dev/null and b/test/resources/52-overwritten-metadata.flac differ
diff --git a/test/resources/flac_application.flac 
b/test/resources/flac_application.flac
new file mode 100644
index 0000000000..026ac5d10e
Binary files /dev/null and b/test/resources/flac_application.flac differ
diff --git a/test/resources/id3v22-test.mp3 b/test/resources/id3v22-test.mp3
new file mode 100644
index 0000000000..f481968023
Binary files /dev/null and b/test/resources/id3v22-test.mp3 differ
diff --git a/test/resources/multipage-setup.ogg 
b/test/resources/multipage-setup.ogg
new file mode 100644
index 0000000000..7ab9791e20
Binary files /dev/null and b/test/resources/multipage-setup.ogg differ
diff --git a/test/resources/silence-44-s.flac b/test/resources/silence-44-s.flac
new file mode 100644
index 0000000000..24e15deb8c
Binary files /dev/null and b/test/resources/silence-44-s.flac differ
diff --git a/test/resources/silence-44-s.mp3 b/test/resources/silence-44-s.mp3
new file mode 100644
index 0000000000..8472632917
Binary files /dev/null and b/test/resources/silence-44-s.mp3 differ
diff --git a/test/resources/variable-block.flac 
b/test/resources/variable-block.flac
new file mode 100644
index 0000000000..b23c9fd0e4
Binary files /dev/null and b/test/resources/variable-block.flac differ
diff --git a/test/resources/vbri.mp3 b/test/resources/vbri.mp3
new file mode 100644
index 0000000000..ea14d61e90
Binary files /dev/null and b/test/resources/vbri.mp3 differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]