Hiroshi SHIBATA
06b14f29a3
Added missing block argument
2025-08-05 13:11:18 +09:00
Hiroshi SHIBATA
015d874133
Sync https://github.com/ruby/test-unit-ruby-core/pull/8
2025-08-05 13:11:18 +09:00
Nobuyoshi Nakada
f0371efbd8
Suppress stderr output in TestRubyOptions#assert_segv
...
It is checked against the given `list`, do not print the same output
twice.
2025-06-16 19:18:11 +09:00
Hiroshi SHIBATA
04b26db5ef
Support Ractor#value and Ractor#join for old versions of Ruby
...
https://github.com/ruby/test-unit-ruby-core/pull/9
https://github.com/ruby/test-unit-ruby-core/pull/10
2025-06-04 14:08:04 +09:00
Nobuyoshi Nakada
4c072c8119
Fix assert_warning
for Proc
...
`Proc` does not have `encoding` method.
Also, make `assert_raise_with_message` accept a `Proc` as the expected
pattern, as well.
2025-03-17 23:42:16 +09:00
Nobuyoshi Nakada
c51668d249
Add Test::Unit::CoreAssertions#assert_raise_kind_of
...
Similar to `Test::Unit::assert_raise`, but allows sub classes too.
2025-01-24 15:51:28 +09:00
Nobuyoshi Nakada
fcb058309b
Accept version range
...
Single `Integer` argument means an exact match to the major version.
2024-09-12 23:47:34 +09:00
Nobuyoshi Nakada
2d12fbc4db
Add predicates for platforms
2024-09-10 16:50:21 +09:00
tomoya ishida
8a7e6f6852
Improve base time of assert_linear_performance ( #11369 )
...
Remove `.ceil` from base time calculation that makes 10x gap.
This will make the assertion more strict and also less flaky.
2024-08-15 06:55:57 +00:00
KJ Tsanaktsidis
fe0b704df5
Skip assert_no_memory_leak when ASAN is enabled
...
ASAN greatly increases the memory footprint of Ruby, so these static
thresholds are not appropriate. There's no real need to run these tests
under ASAN.
[Bug #20274 ]
2024-02-28 14:41:03 +11:00
Hiroshi SHIBATA
bb849ffdb1
Added explicitly begin-end block for Ruby 2.4.
...
strscan, ipaddr and some default gems still support Ruby 2.4.
After this, I extract this CoreAssertions to their repositories.
2023-10-20 14:34:08 +09:00
Hiroshi SHIBATA
f1c78b2331
Suppress warning for shadowing outer local variable
2023-09-12 15:10:16 +09:00
Hiroshi SHIBATA
141102b0b0
Expose Test.filter_backtrace for the default gems.
2023-08-29 15:05:30 +09:00
Nobuyoshi Nakada
d239643603
core_assertions.rb: Support old rubies
...
Some symbol argument might not be accepted by Process.clock_gettime.
2023-04-29 11:28:26 +09:00
Nobuyoshi Nakada
533423ebe4
core_assertions.rb: Prefer CPU time clocks
...
To prevent influence from other processes.
2023-04-06 00:19:03 +09:00
Nobuyoshi Nakada
f9eb2515a3
core_assertions.rb: Extract common code block
2023-04-06 00:19:03 +09:00
Nobuyoshi Nakada
f07c756494
core_assertions.rb: Tweak timeout limit
...
Increase the timeout limit when variance at rehearsal is small.
2023-04-06 00:19:03 +09:00
Takashi Kokubun
3fe134759c
Skip assert_linear_performance for RJIT
2023-04-02 12:23:23 -07:00
Nobuyoshi Nakada
db7c38634e
core_assertions.rb: Raise Timeout::Error
explicitly
...
So that `assert_raise` inside the block works.
2023-03-23 14:49:41 +09:00
Nobuyoshi Nakada
e340eb2106
core_assertions.rb: Fix backward compatibility with pre 2.7
2023-03-22 23:07:26 +09:00
Nobuyoshi Nakada
27916db08c
[DOC] Update comment of assert_pattern_list
...
`pattern_list` may contain string since d903e76726
.
2023-03-22 22:35:58 +09:00
Nobuyoshi Nakada
09bda4ceb5
core_assertions.rb: Refine assert_linear_performance
...
* Calculate each timeout from the ratio of each factor to the first
factor.
2023-03-22 18:53:12 +09:00
Nobuyoshi Nakada
ccd2dbc4c1
core_assertions.rb: Relax assert_linear_performance
...
* Use an `Enumerable` as factors, instead of three arguments.
* Include `assert_operator` time in rehearsal time.
* Round up max expected time.
2023-03-18 02:41:02 +09:00
Takashi Kokubun
a8e7fee801
Revert "core_assertions.rb: Refine assert_linear_performance
"
...
This reverts commit cae4342dd5
.
This is failing a lot of CIs and nobody is actively looking into fixing
it. Let me revert this until we have a solution to it.
2023-03-16 09:22:42 -07:00
Nobuyoshi Nakada
cae4342dd5
core_assertions.rb: Refine assert_linear_performance
...
* Use an `Enumerable` as factors, instead of three arguments.
2023-03-16 18:51:02 +09:00
Nobuyoshi Nakada
09041a6ee8
core_assertions.rb: Refine assert_linear_performance
...
* Add `rehearsal` keyword argument
* Stop repeating with the same factor
2023-03-15 18:19:31 +09:00
Nobuyoshi Nakada
7ce4b716bd
Add test for linear performance
2023-03-12 18:50:39 +09:00
Nobuyoshi Nakada
781222a8bc
core_assertions.rb: Consider backward compatibilities
...
This file is copied to default gems, which might support older
versions.
2023-03-12 18:40:41 +09:00
Takashi Kokubun
2e875549a9
s/MJIT/RJIT/
2023-03-06 23:44:01 -08:00
Hiroshi SHIBATA
b496578758
Skip Test::Unit::AutoRunner logic in ruby/ruby repository
2023-01-05 08:16:24 +09:00
Hiroshi SHIBATA
1f2fef1f9a
[ruby/openssl] Stop AutoRunner with test-unit
...
0d4cd8b9ca
2023-01-05 08:06:49 +09:00
Hiroshi SHIBATA
f229b36087
Fix test fail with assert_ractor outside of ruby/ruby repo
...
Revert 806583c093
2022-09-01 16:15:51 +09:00
Nobuyoshi Nakada
d903e76726
Allow strings in assert_pattern_list
2022-08-19 01:28:31 +09:00
Nobuyoshi Nakada
f159bbd17d
Prevent accidental use of assert_raises
2022-06-25 19:09:06 +09:00
Nobuyoshi Nakada
8780f15fd7
[ruby/date] Use assert_deprecated_warn
...
c55004715a
2022-02-25 20:39:47 +09:00
Jesse Chavez
99d02caed3
[ruby/logger] Fix log rotation inter-process lock failed.
...
Issue only occurs in JRuby 9.3.0.0 and Windows and the full
console output is:
log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log writing failed. closed stream
...
19fc734638
2022-01-27 12:33:06 +09:00
David Rodríguez
de678cd51e
[ruby/pathname] Officially drop support for ruby 2.6 or older
...
The gem doesn't even install on old rubies, but since the gemspec claims
it's supported, `gem install pathname` will try to install it and print
an error.
This commit doesn't fix the above issue. The only way to fix it would be
to restore support and release a new version that actually supports old
rubies. However, such a change has been proposed and ignored for a long
time.
So this issue proposes to leave that broken but at least bring the
gemspec manifest and the CI matrix in sync to hopefully avoid this issue
from happening again in the future.
3ee010b538
2022-01-25 08:50:31 +09:00
Takashi Kokubun
1a63468831
Prepare for removing RubyVM::JIT ( #5262 )
2021-12-13 23:07:46 -08:00
Nobuyoshi Nakada
438220f063
Let pretty_inspect work once at first
...
For older pp.rb which did not need io/console, and dealing with
`LoadError`.
2021-11-30 14:16:33 +09:00
Nobuyoshi Nakada
d400c44a55
Load io/console earlier
...
Something goes wrong at loading libraries inside `mu_pp` in the
test overriding `Class.inherited`.
2021-11-30 13:15:22 +09:00
Pavel Rosický
94882df3a2
[ruby/digest] jruby support
...
2e9dc14693
2021-10-12 20:46:13 +09:00
Nobuyoshi Nakada
c423cc932e
Refactor Test::Unit::CoreAssertions#assert_nothing_raised
...
* Separate exception classes to be rescued or reraised
* Use the filtered backtrace in the failure message
* Raise a new `AssertionFailedError` with the original backtrace
2021-10-09 18:14:21 +09:00
Nobuyoshi Nakada
3932227d96
Unify Test::Unit::Assertions#message
...
Merge `Test::Unit::CoreAssertions#message`.
2021-10-09 16:17:01 +09:00
Nobuyoshi Nakada
489c22b17f
Let Test::Unit::CoreAssertions::AllFailures#for
yield the key
...
Similar to `Test::Unit::CoreAssertions::AllFailures#foreach`.
2021-10-09 14:28:27 +09:00
Nobuyoshi Nakada
aaa9805e7e
Add unique token to separated runner
...
Same as Test::Unit::CoreAssertions#assert_no_memory_leak.
2021-09-13 15:47:45 +09:00
Nobuyoshi Nakada
30b4da2bc1
Update the test tool path
2021-09-11 16:26:00 +09:00
Hiroshi SHIBATA
806583c093
Change include order for test assertions
2021-09-11 15:17:38 +09:00
Hiroshi SHIBATA
9583d2057d
Added missing Assertions for assert_file_predicate
2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
d05383812a
Replace Test::Assertion and Test::Skip to Test::Unit::AssertionFailedError and Test::Unit::PendedError
2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
151a1cd45e
Fixed inconsistent require order for assertions and core_assertions
2021-09-11 08:48:03 +09:00