From 591018c5bbe0e01f96b4d720a12cc855458b03d9 Mon Sep 17 00:00:00 2001 From: Ed Baker Date: Sat, 10 Aug 2024 16:28:54 +0100 Subject: [PATCH] Test .spectrogram_mmad_power() --- tests/testthat/test-scikit-maad-classes.R | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/testthat/test-scikit-maad-classes.R diff --git a/tests/testthat/test-scikit-maad-classes.R b/tests/testthat/test-scikit-maad-classes.R new file mode 100644 index 0000000..ff6a6c1 --- /dev/null +++ b/tests/testthat/test-scikit-maad-classes.R @@ -0,0 +1,17 @@ +test_that(".spectrogram_maad_power works as expected", { + f <- f <- system.file("extdata", "AUDIOMOTH.WAV", package="sonicscrewdriver") + w <- readWave(f) + + spec <- .spectrogram_maad_power(w) + expect_s4_class(spec, "spectrogram_maad") + + spec <- .spectrogram_maad_power(tagWave(w)) + expect_s4_class(spec, "spectrogram_maad") + + w <- tuneR::WaveMC(tuneR::stereo(w,w)) + spec <- .spectrogram_maad_power(w) + expect_s4_class(spec, "spectrogram_maad") + + spec <- .spectrogram_maad_power(maad_spectrogram(w)) + expect_s4_class(spec, "spectrogram_maad") +})