| 1 | ;;; emms-info-native-tests.el --- Test suite for emms-info-native -*- lexical-binding: t; -*- |
| 2 | |
| 3 | ;; Copyright (C) 2023 Free Software Foundation, Inc. |
| 4 | |
| 5 | ;; Author: Petteri Hintsanen <petterih@iki.fi> |
| 6 | |
| 7 | ;; This file is part of EMMS. |
| 8 | |
| 9 | ;; EMMS is free software; you can redistribute it and/or modify it |
| 10 | ;; under the terms of the GNU General Public License as published by |
| 11 | ;; the Free Software Foundation; either version 3, or (at your option) |
| 12 | ;; any later version. |
| 13 | |
| 14 | ;; EMMS is distributed in the hope that it will be useful, but WITHOUT |
| 15 | ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 16 | ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
| 17 | ;; License for more details. |
| 18 | |
| 19 | ;; You should have received a copy of the GNU General Public License |
| 20 | ;; along with EMMS; see the file COPYING. If not, write to the Free |
| 21 | ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 22 | ;; MA 02110-1301, USA. |
| 23 | |
| 24 | ;;; Commentary: |
| 25 | |
| 26 | ;; This test suite exercises `emms-info-native' with various input |
| 27 | ;; files. |
| 28 | |
| 29 | ;;; Code: |
| 30 | |
| 31 | (require 'emms-info-native) |
| 32 | (require 'ert) |
| 33 | |
| 34 | (ert-deftest emms-test-info-native-mp3 () |
| 35 | (should (equal (emms-info-native--decode-info-fields |
| 36 | "resources/sine.mp3") |
| 37 | '(("year" . "2023") |
| 38 | ("album" . "Test Data ☺") |
| 39 | ("artist" . "EMMS project") |
| 40 | ("title" . "440 Hz sine wave") |
| 41 | ("playing-time" . 5))))) |
| 42 | |
| 43 | (ert-deftest emms-test-info-native-ogg () |
| 44 | (should (equal (emms-info-native--decode-info-fields |
| 45 | "resources/sine.ogg") |
| 46 | '(("artist" . "EMMS project") |
| 47 | ("date" . "2023-09-02") |
| 48 | ("title" . "440 Hz sine wave") |
| 49 | ("album" . "Test Data ☺") |
| 50 | ("playing-time" . 5))))) |
| 51 | |
| 52 | (ert-deftest emms-test-info-native-flac () |
| 53 | (should (equal (emms-info-native--decode-info-fields |
| 54 | "resources/sine.flac") |
| 55 | '(("artist" . "EMMS project") |
| 56 | ("date" . "2023-09-02") |
| 57 | ("title" . "440 Hz sine wave") |
| 58 | ("album" . "Test Data ☺") |
| 59 | ("playing-time" . 5))))) |
| 60 | |
| 61 | (ert-deftest emms-test-info-native-opus () |
| 62 | (should (equal (emms-info-native--decode-info-fields |
| 63 | "resources/sine.opus") |
| 64 | '(("artist" . "EMMS project") |
| 65 | ("date" . "2023-09-02") |
| 66 | ("title" . "440 Hz sine wave") |
| 67 | ("album" . "Test Data ☺") |
| 68 | ("playing-time" . 5))))) |
| 69 | |
| 70 | ;;; emms-info-native-tests.el ends here |