Class: TesCompactIf

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/tester/test_unit.rb

Instance Method Summary collapse

Instance Method Details

#test_CompactIfObject



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/tester/test_unit.rb', line 225

def test_CompactIf
  assert_equal(4, LangParser.new.calc_test("x = 4
                                            #{$if} 7 <= 10 #{$and} > 5
                                              x
                                            #{$end}"))

  assert_equal(8, LangParser.new.calc_test("x = 8
                                            #{$if} x < 10 #{$and} > 5
                                              x
                                            #{$end}"))

  assert_equal(nil, LangParser.new.calc_test("x = 2
                                            #{$if} x <= 10 #{$and} >= 5
                                              x
                                            #{$end}"))
end