Skip to content

Commit

Permalink
Merge pull request #1810 from ksss/set-with-raap
Browse files Browse the repository at this point in the history
Introduce RaaP for testing of signature
  • Loading branch information
soutaro committed May 29, 2024
2 parents 7301694 + 9a8cd5e commit 1d42c1c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- ruby: "3.3"
job: lexer compile confirm_lexer
- ruby: "3.3"
job: rubocop validate test_doc build test_generate_stdlib
job: rubocop validate test_doc build test_generate_stdlib raap
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gem "base64"
gem "mutex_m"
gem "nkf"
gem "fileutils"
gem "raap"

# Performance profiling and benchmarking
gem 'stackprof'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ GEM
psych (4.0.6)
stringio
public_suffix (5.0.5)
raap (0.7.0)
rbs (~> 3.0)
timeout (~> 0.4)
racc (1.8.0)
rainbow (3.1.1)
rake (13.2.1)
Expand Down Expand Up @@ -120,6 +123,7 @@ DEPENDENCIES
mutex_m
net-smtp
nkf
raap
rake
rake-compiler
rbs!
Expand Down
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ task :stdlib_test => :compile do
sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Encoding_test.rb"
end

task :raap => :compile do
sh %q[cat test/raap.txt | egrep -v '^#|^$' | xargs bundle exec raap]
end

task :rubocop do
sh "rubocop --parallel"
end
Expand Down
20 changes: 13 additions & 7 deletions core/set.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class Set[unchecked out A]
# Equivalent to Set#delete_if, but returns nil if no changes were
# made. Returns an enumerator if no block is given.
#
def reject!: () { (A) -> untyped } -> self
def reject!: () { (A) -> untyped } -> self?

# <!--
# rdoc-file=lib/set.rb
Expand All @@ -437,7 +437,7 @@ class Set[unchecked out A]
# Set[1, 2, 3].disjoint? [3, 4] #=> false
# Set[1, 2, 3].disjoint? 4..5 #=> true
#
def disjoint?: (_Each[A]) -> bool
def disjoint?: (Set[A] | Enumerable[A]) -> bool

# <!--
# rdoc-file=lib/set.rb
Expand All @@ -458,8 +458,8 @@ class Set[unchecked out A]
#
# Returns an enumerator if no block is given.
#
def divide: () { (A, A) -> untyped } -> Set[self]
| () { (A) -> untyped } -> Set[self]
def divide: () { (A, A) -> Hash::_Key } -> Set[self]
| () { (A) -> Hash::_Key } -> Set[self]

# <!--
# rdoc-file=lib/set.rb
Expand Down Expand Up @@ -500,7 +500,7 @@ class Set[unchecked out A]
# Set[1, 2, 3].intersect? 4..5 #=> false
# Set[1, 2, 3].intersect? [3, 4] #=> true
#
def intersect?: (_Each[A]) -> bool
def intersect?: (Set[A] | Enumerable[A]) -> bool

# <!--
# rdoc-file=lib/set.rb
Expand Down Expand Up @@ -534,7 +534,7 @@ class Set[unchecked out A]
# Merges the elements of the given enumerable objects to the set and
# returns self.
#
def merge: (_Each[A]) -> self
def merge: (*_Each[A]) -> self

# <!--
# rdoc-file=lib/set.rb
Expand All @@ -544,7 +544,13 @@ class Set[unchecked out A]
#
def subset?: (self) -> bool

def proper_subst?: (self) -> bool
# <!--
# rdoc-file=lib/set.rb
# - proper_subset?(set)
# -->
# Returns true if the set is a proper subset of the given set.
#
def proper_subset?: (self) -> bool

# <!--
# rdoc-file=lib/set.rb
Expand Down
6 changes: 6 additions & 0 deletions test/raap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Specify the class/module and method names to be executed by RaaP.
# By prefixing with `!`, you can skip testing a method.
# Lines beginning with `#` are comments.

Set[Integer]
Enumerable[Integer]#to_set

0 comments on commit 1d42c1c

Please sign in to comment.