Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ff9b41cc
Commit
ff9b41cc
authored
Jan 09, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1654 from iij/pr-not-match-operator
add operator "!~".
parents
a02eb4bd
83413218
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
mrblib/kernel.rb
mrblib/kernel.rb
+5
-0
test/t/kernel.rb
test/t/kernel.rb
+21
-0
No files found.
mrblib/kernel.rb
View file @
ff9b41cc
...
@@ -43,4 +43,9 @@ module Kernel
...
@@ -43,4 +43,9 @@ module Kernel
yield
yield
end
end
end
end
# 11.4.4 Step c)
def
!~
(
y
)
!
(
self
=~
y
)
end
end
end
test/t/kernel.rb
View file @
ff9b41cc
...
@@ -479,6 +479,27 @@ assert('Kernel#!=') do
...
@@ -479,6 +479,27 @@ assert('Kernel#!=') do
assert_false
(
str2
!=
str1
)
assert_false
(
str2
!=
str1
)
end
end
# operator "!~" is defined in ISO Ruby 11.4.4.
assert
(
'Kernel#!~'
)
do
x
=
"x"
def
x
.
=
~
(
other
)
other
==
"x"
end
assert_false
x
!~
"x"
assert_true
x
!~
"z"
y
=
"y"
def
y
.
=
~
(
other
)
other
==
"y"
end
def
y
.!~
(
other
)
other
==
"not y"
end
assert_false
y
!~
"y"
assert_false
y
!~
"z"
assert_true
y
!~
"not y"
end
assert
(
'Kernel#respond_to_missing?'
)
do
assert
(
'Kernel#respond_to_missing?'
)
do
class
Test4RespondToMissing
class
Test4RespondToMissing
def
respond_to_missing?
(
method_name
,
include_private
=
false
)
def
respond_to_missing?
(
method_name
,
include_private
=
false
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment