summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_linked_list.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-04 12:31:31 +0000
commitc4ee0df8ba2cf7cc6aaa785c8df20a91b1719021 (patch)
tree06beca468cce4a75a3e9890d18aa001ef2c41e54 /test/rake/test_rake_linked_list.rb
parent8c0b2a286080609613b6b007e030ff7c7adaa23c (diff)
* lib/rake/*: Gemify rake [fix GH-862][Feature #11025]
* test/rake/*: ditto. * tool/rbinstall.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_linked_list.rb')
-rw-r--r--test/rake/test_rake_linked_list.rb84
1 files changed, 0 insertions, 84 deletions
diff --git a/test/rake/test_rake_linked_list.rb b/test/rake/test_rake_linked_list.rb
deleted file mode 100644
index 32d73062688..00000000000
--- a/test/rake/test_rake_linked_list.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-require File.expand_path('../helper', __FILE__)
-
-class TestLinkedList < Rake::TestCase
- include Rake
-
- def test_empty_list
- empty = LinkedList::EMPTY
- assert empty.empty?, "should be empty"
- end
-
- def test_list_with_one_item
- list = LinkedList.make(:one)
- assert ! list.empty?, "should not be empty"
- assert_equal :one, list.head
- assert_equal LinkedList::EMPTY, list.tail
- end
-
- def test_make_with_no_arguments
- empty = LinkedList.make()
- assert_equal LinkedList::EMPTY, empty
- end
-
- def test_make_with_one_argument
- list = LinkedList.make(:one)
- assert ! list.empty?
- assert_equal :one, list.head
- assert_equal LinkedList::EMPTY, list.tail
- end
-
- def test_make_with_two_arguments
- list = LinkedList.make(:one, :two)
- assert ! list.empty?
- assert_equal :one, list.head
- assert_equal :two, list.tail.head
- assert_equal LinkedList::EMPTY, list.tail.tail
- end
-
- def test_list_with_several_items
- list = LinkedList.make(:one, :two, :three)
-
- assert ! list.empty?, "should not be empty"
- assert_equal :one, list.head
- assert_equal :two, list.tail.head
- assert_equal :three, list.tail.tail.head
- assert_equal LinkedList::EMPTY, list.tail.tail.tail
- end
-
- def test_lists_are_structurally_equivalent
- list = LinkedList.make(1, 2, 3)
- same = LinkedList.make(1, 2, 3)
- diff = LinkedList.make(1, 2, 4)
- short = LinkedList.make(1, 2)
-
- assert_equal list, same
- refute_equal list, diff
- refute_equal list, short
- refute_equal short, list
- end
-
- def test_conversion_to_string
- list = LinkedList.make(:one, :two, :three)
- assert_equal "LL(one, two, three)", list.to_s
- assert_equal "LL()", LinkedList.make().to_s
- end
-
- def test_conversion_with_inspect
- list = LinkedList.make(:one, :two, :three)
- assert_equal "LL(:one, :two, :three)", list.inspect
- assert_equal "LL()", LinkedList.make().inspect
- end
-
- def test_lists_are_enumerable
- list = LinkedList.make(1, 2, 3)
- new_list = list.map { |item| item + 10 }
- expected = [11, 12, 13]
- assert_equal expected, new_list
- end
-
- def test_conjunction
- list = LinkedList.make.conj("C").conj("B").conj("A")
- assert_equal LinkedList.make("A", "B", "C"), list
- end
-
-end