https://svn.lrde.epita.fr/svn/ranch/trunk
Index: ChangeLog
from Nicolas Despr�s <nicolas.despres(a)gmail.com>
Fix buggy input fixtures.
* web/ranch/test/unit/input_test.rb: Adapt test to no buggy fixtures.
* web/ranch/test/fixtures/inputs.yml: Generate correct fixtures.
fixtures/inputs.yml | 18 ++++++++----------
unit/input_test.rb | 4 ++--
2 files changed, 10 insertions(+), 12 deletions(-)
Index: web/ranch/test/unit/input_test.rb
--- web/ranch/test/unit/input_test.rb (revision 58)
+++ web/ranch/test/unit/input_test.rb (working copy)
@@ -16,13 +16,13 @@
end
def test_save_arg_num_is_positive
- input = inputs("determinize_r1_foo_1")
+ input = inputs("determinize_foo_1_3")
input.arg_num = -1
assert !input.save
end
def test_save_set_num_is_positive_or_zero
- input = inputs("determinize_r1_foo_1")
+ input = inputs("determinize_foo_1_3")
input.set_num = -1
assert !input.save
end
Index: web/ranch/test/fixtures/inputs.yml
--- web/ranch/test/fixtures/inputs.yml (revision 58)
+++ web/ranch/test/fixtures/inputs.yml (working copy)
@@ -2,25 +2,24 @@
# Generate a set of determinize inputs.
-<% (1..10).each do |bench_id| %>
-
<% val = 2
set_num = 0
while set_num < 4 do %>
<% arg_num = 1
- {
- 'nb_states' => '',
- 'nb_transition' => '',
- 'foo' => 'unit_foo'
- }.each do |name, unit| %>
+ [
+ [ 'nb_states', '' ],
+ [ 'nb_transition','' ],
+ [ 'foo', 'unit_foo' ]
+ ].each do |item|
+ name, unit = item %>
-<%= "determinize_r#{bench_id}_#{name}_#{set_num}:" %>
+<%= "determinize_#{name}_#{set_num}_#{arg_num}:" %>
id: <%= id += 1 %>
name: <%= name %>
unit: <%= unit.inspect %>
value: <%= val %>
- bench_id: <%= bench_id %>
+ bench_id: 1
arg_num: <%= arg_num %>
set_num: <%= set_num %>
@@ -29,5 +28,4 @@
<% val *= 2
set_num += 1
end %>
-<% end %>