From dfbefc7cb72b2c60e2cb076b33a5964e1be21f33 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Aug 2013 22:33:54 +0000 Subject: format: fix switching to floating point samples Regexps are hard to write sometimes :x Anyways, we should support using floating-point internally for users who prefer it. --- test/test_format.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/test_format.rb b/test/test_format.rb index 00fb3e3..bc08cb4 100644 --- a/test/test_format.rb +++ b/test/test_format.rb @@ -44,4 +44,14 @@ class TestFormat < Minitest::Unit::TestCase fmt.type = "s16" assert_equal 2, fmt.bytes_per_sample end + + def test_valid_type + fmt = DTAS::Format.new + %w(s16 s24 s32 f32 f64).each do |t| + assert fmt.valid_type?(t) + end + %w(flac wav wtf).each do |t| + refute fmt.valid_type?(t) + end + end end -- cgit v1.2.3-24-ge0c7