2018-09-12 14:21:24 +00:00
|
|
|
# frozen_string_literal: true
|
2018-09-12 13:15:43 +00:00
|
|
|
|
2016-03-19 15:13:05 +00:00
|
|
|
Mutant::Meta::Example.add :case do
|
2014-06-02 12:57:14 +00:00
|
|
|
source <<-RUBY
|
|
|
|
case
|
|
|
|
when true
|
|
|
|
else
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
2014-06-05 16:37:31 +00:00
|
|
|
singleton_mutations
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
mutation <<-RUBY
|
|
|
|
case
|
|
|
|
when true
|
|
|
|
raise
|
|
|
|
else
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
mutation <<-RUBY
|
|
|
|
case
|
|
|
|
when false
|
|
|
|
else
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
mutation <<-RUBY
|
|
|
|
case
|
|
|
|
when nil
|
|
|
|
else
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
end
|
|
|
|
|
2016-03-19 15:13:05 +00:00
|
|
|
Mutant::Meta::Example.add :case do
|
2014-06-02 12:57:14 +00:00
|
|
|
source <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
2014-06-05 16:37:31 +00:00
|
|
|
singleton_mutations
|
2014-06-02 12:57:14 +00:00
|
|
|
|
|
|
|
mutation <<-RUBY
|
|
|
|
case nil
|
2014-06-05 16:37:31 +00:00
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case self
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
2014-06-02 12:57:14 +00:00
|
|
|
raise
|
2014-06-05 16:37:31 +00:00
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
2014-06-02 12:57:14 +00:00
|
|
|
when nil
|
2014-06-05 16:37:31 +00:00
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when self
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
nil
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
self
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
2014-06-05 16:37:31 +00:00
|
|
|
mutation <<-RUBY
|
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when nil, C
|
|
|
|
C
|
|
|
|
else
|
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when self, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, nil
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, self
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
D
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
|
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
else
|
2014-06-05 16:37:31 +00:00
|
|
|
self
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
|
2014-06-02 12:57:14 +00:00
|
|
|
mutation <<-RUBY
|
2014-06-05 16:37:31 +00:00
|
|
|
case condition
|
|
|
|
when A
|
|
|
|
when B, C
|
|
|
|
C
|
2014-06-02 12:57:14 +00:00
|
|
|
end
|
|
|
|
RUBY
|
|
|
|
end
|