Add the chopsticks code at RubyKaigi2023
This commit is contained in:
parent
94ac77c955
commit
d1b6ff42fa
@ -214,6 +214,30 @@ class TestTRICK2022 < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
class TestRubyKaigi2023🥢 < Test::Unit::TestCase
|
||||
CHOPSTICKS = [<<~'0', <<~'1'] # by mame
|
||||
BEGIN{q=:Ruby};p||=:Enjoy;END{puts p,q||2023}
|
||||
0
|
||||
q=print(q||"/:|}\n")||p&&:@Matsumoto;p=:Kaigi
|
||||
1
|
||||
|
||||
def test_chopsticks_0
|
||||
assert_in_out_err([], CHOPSTICKS[0], %w[Enjoy Ruby])
|
||||
end
|
||||
|
||||
def test_chopsticks_1
|
||||
assert_in_out_err([], CHOPSTICKS[1], %w[/:|}])
|
||||
end
|
||||
|
||||
def test_chopsticks_0_1
|
||||
assert_in_out_err([], "#{CHOPSTICKS[0]}\n#{CHOPSTICKS[1]}", %w[RubyKaigi @Matsumoto])
|
||||
end
|
||||
|
||||
def test_chopsticks_1_0
|
||||
assert_in_out_err([], "#{CHOPSTICKS[1]}\n#{CHOPSTICKS[0]}", %w[RubyKaigi 2023])
|
||||
end
|
||||
end
|
||||
|
||||
# https://github.com/mame/all-ruby-quine
|
||||
class TestAllRubyQuine < Test::Unit::TestCase
|
||||
def test_all_ruby_quine
|
||||
|
Loading…
x
Reference in New Issue
Block a user