Skip to content

Commit 1c4d5bf

Browse files
committed
Uncomment test
1 parent cd976c9 commit 1c4d5bf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/tests/mml2midi_test.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def q_note_following_rest_case
112112

113113
description "Super Mario A part"
114114
def mario_a_case
115+
durations = [92, 92, 90, 116, 98, 116, 50]
116+
115117
[
116118
"T200 L8 O5 Q4 e e r e r c e r g r4. > g r4.",
117119
"T200 L8 Q6 < c r4 > g r4 e r4 a r b r b- a r",
@@ -120,14 +122,15 @@ def mario_a_case
120122
"T200 L8 Q6 r4 g g- f d+ r e r < c r c c r4.",
121123
"T200 L8 Q6 r4 > g g- f d+ r e r > g+ a < c r > a < c d",
122124
"T200 L8 Q6 r4 e-8 r4 d r4 c r r4 r2"
123-
].each do |measure|
125+
].each_with_index do |measure, index|
124126
duration = MML2MIDI.new.compile(measure) { |p, d| @data << [p, d] }
125-
# assert_equal 60, duration
127+
assert_equal durations[index], duration
126128
end
127129
end
128130

129131
description "Super Mario B part"
130132
def mario_b_case
133+
durations = [92, 92, 90, 80, 104, 80, 92]
131134
[
132135
"T200 L8 O3 Q4 d d r d r d d r g r4. > g r4.",
133136
"T200 L8 Q6 < g r4 e r4 c r4 f r g r g- f r",
@@ -136,20 +139,21 @@ def mario_b_case
136139
"T200 L8 Q6 c r4 e r4 g < c r < f r f f r >> g r",
137140
"T200 L8 Q6 c r4 g r4 < c r > f r4 < c r4 > f r",
138141
"T200 L8 Q6 c r a- r4 b- r4 < c r4 > g g r c r"
139-
].each do |measure|
142+
].each_with_index do |measure, index|
140143
duration = MML2MIDI.new.compile(measure) { |p, d| @data << [p, d] }
141-
# assert_equal 48, duration
144+
assert_equal durations[index], duration
142145
end
143146
end
144147

145148
description "Danger Zone"
146149
def danger_zone_case
150+
durations = [320, 362]
147151
[
148152
"T120 Q6 L8 r O2 c d f g4 f4 < g a r4 a4. a r4 a a a4 a4 g a r4 a4. a r4 a a < c4 c4 > Q8 g1 Q6 g1 g a r4 a4. a r4 a a a4 a4 g a r4 a4. a r4 a a a4 a4",
149153
"T120 Q6 L8 r O2 c d f g4 f4 d << d r4 d4. d >> r c d f g4 f4 d << d r4 d4. d >> r c d f g4 f4 c4. > g < c2 d c4 > g < c4 c4 d4. d d2 r c d f g4 f4 d4. d d2 r c d f g4 f4"
150-
].each do |measure|
154+
].each_with_index do |measure, index|
151155
duration = MML2MIDI.new.compile(measure) { |p, d| @data << [p, d] }
152-
# assert_equal 238, duration
156+
assert_equal durations[index], duration
153157
end
154158
end
155159
end

0 commit comments

Comments
 (0)