switch from test-unit to minitest
This commit is contained in:
parent
9480c49272
commit
7fce85d694
12 changed files with 29 additions and 28 deletions
|
@ -1,10 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestParser < Test::Unit::TestCase
|
||||
class TestParser < MiniTest::Test
|
||||
def test_stack_extract
|
||||
interpreter = Rpl.new( [{ value: 1, type: :numeric },
|
||||
{ value: 2, type: :numeric }] )
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageBranch < Test::Unit::TestCase
|
||||
class TestLanguageBranch < MiniTest::Test
|
||||
def test_loop
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '« "hello no." swap + » 11 16 loop'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageFileSystem < Test::Unit::TestCase
|
||||
class TestLanguageFileSystem < MiniTest::Test
|
||||
def test_fread
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '"spec/test.rpl" fread'
|
||||
|
@ -39,7 +39,8 @@ trrr
|
|||
assert_equal [],
|
||||
interpreter.stack
|
||||
|
||||
assert_true File.exist?( 'spec/test_fwrite.txt' )
|
||||
assert_equal true,
|
||||
File.exist?( 'spec/test_fwrite.txt' )
|
||||
|
||||
written_content = File.read( 'spec/test_fwrite.txt' )
|
||||
assert_equal 'Ceci est un test de fwrite',
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TesttLanguageOperations < Test::Unit::TestCase
|
||||
class TesttLanguageOperations < MiniTest::Test
|
||||
def test_add
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '1 2 +'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageProgram < Test::Unit::TestCase
|
||||
class TestLanguageProgram < MiniTest::Test
|
||||
def test_eval
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '« 2 dup * dup » eval'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageStack < Test::Unit::TestCase
|
||||
class TestLanguageStack < MiniTest::Test
|
||||
def test_swap
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '1 2 swap'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageProgram < Test::Unit::TestCase
|
||||
class TestLanguageProgram < MiniTest::Test
|
||||
def test_sto
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '« 2 dup * » \'quatre\' sto'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageString < Test::Unit::TestCase
|
||||
class TestLanguageString < MiniTest::Test
|
||||
def test_to_string
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '2 →str'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageTest < Test::Unit::TestCase
|
||||
class TestLanguageTest < MiniTest::Test
|
||||
def test_greater_than
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '0 0.1 >'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestLanguageTimeDate < Test::Unit::TestCase
|
||||
class TestLanguageTimeDate < MiniTest::Test
|
||||
def test_time
|
||||
now = Time.now.to_s
|
||||
interpreter = Rpl.new
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TesttLanguageOperations < Test::Unit::TestCase
|
||||
class TesttLanguageOperations < MiniTest::Test
|
||||
def test_pi
|
||||
interpreter = Rpl.new
|
||||
interpreter.run 'pi'
|
||||
|
@ -55,7 +55,7 @@ class TesttLanguageOperations < Test::Unit::TestCase
|
|||
interpreter.stack
|
||||
end
|
||||
|
||||
def test_d→r
|
||||
def test_d2r
|
||||
interpreter = Rpl.new
|
||||
interpreter.run '90 d→r'
|
||||
assert_equal [{ value: BigMath.PI( interpreter.precision ) / 2,
|
||||
|
@ -63,10 +63,10 @@ class TesttLanguageOperations < Test::Unit::TestCase
|
|||
interpreter.stack
|
||||
end
|
||||
|
||||
def test_r→d
|
||||
def test_r2d
|
||||
interpreter = Rpl.new
|
||||
interpreter.run 'pi r→d'
|
||||
assert_equal [{ value: 180, type: :numeric, base: 10 }],
|
||||
assert_equal [{ value: BigDecimal( 180 ), type: :numeric, base: 10 }],
|
||||
interpreter.stack
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test/unit'
|
||||
require 'minitest/autorun'
|
||||
|
||||
require 'rpl'
|
||||
|
||||
class TestParser < Test::Unit::TestCase
|
||||
class TestParser < MiniTest::Test
|
||||
def test_number
|
||||
result = Rpl.new.parse( '1' )
|
||||
assert_equal [{ value: 1, type: :numeric, base: 10 }], result
|
||||
|
|
Loading…
Reference in a new issue