Commit graph

28 commits

Author SHA1 Message Date
Stan Lo
9751b54971 [ruby/irb] Improve testing infra
(https://github.com/ruby/irb/pull/442)

* Add test_in_isolation task to run tests in isolation

This simulates how tests are run in Ruby CI and can detect some issues
before they're merged and break Ruby CI later.

* Run test_in_isolation task on CI

* Fix TestRaiseNoBacktraceException's setup

51f23c58b0
2022-11-15 17:26:51 +00:00
Stan Lo
a923203811 [ruby/irb] Provide a base test class and let tests restore encodings
conveniently
(https://github.com/ruby/irb/pull/429)

* Create a base TestIRB::TestCase class

* Save/restore encodings for tests that initializes InputMethod classes

Because `RelineInputMethod#initializes` calls `set_encoding`, which
changes stdio/out/err and Encoding's default encoding values, we need to
make sure any test that directly or indirectly (e.g. through Context)
initializes `RelineInputMethod` restores encodings.

`ReadlineInputMethod` also changes encodings but currently no tests
cover it.

* Remove unnecessary TestHelper module

Since we now have a base TestCase, without_rdoc can just live there.

c2874ec121
2022-11-03 22:13:11 +00:00
Benoit Daloze
bb7067cbdf [ruby/irb] Suppress warning for test which uses a locale non-existing on GitHub Actions 2022-10-27 19:16:52 +00:00
Benoit Daloze
8d7844235c [ruby/irb] Remove unecesary and harmful pend for TruffleRuby in TestRaiseNoBacktraceException
* Specifically the second one causes `$HOME` to be unset, which breaks `File.expand_path('~')`.

61963305f5
2022-10-27 19:16:51 +00:00
Hiroshi SHIBATA
598f4f4219 [ruby/irb] Use pend instead of skip
f441ce35bf
2021-08-30 12:39:23 +09:00
Nobuyoshi Nakada
34bc8210ed
test/irb/test_raise_no_backtrace_exception.rb: fix test file path
Create a file for test under the temporary directory.
2021-05-18 16:04:37 +09:00
Yusuke Endoh
1b61cdd5e0 test/irb/test_raise_no_backtrace_exception.rb: Set LC_MESSAGES as UTF-8 2021-05-11 19:38:06 +09:00
Takashi Kokubun
66ca6ede16 [ruby/irb] Skip test_raise_exception_with_invalid_byte_sequence
on Windows for now. It seems like we haven't figured this out yet.

ecf5a1ace1
2021-05-11 14:46:33 +09:00
Takashi Kokubun
afa70d079f
Explicitly specify encoding for another test as well
Same as e2ccc3301e
39102539/job/k8m1yrrjesxbgvtq
2021-05-10 21:41:36 -07:00
Yusuke Endoh
e2ccc3301e test/irb/test_raise_no_backtrace_exception.rb: UTF-8 is expected
... for the output of assert_in_out_err.

This will fix the following failure on many CI machines

20210511T030005Z.fail.html.gz
```
  1) Failure:
TestIRB::TestRaiseNoBacktraceException#test_raise_exception_with_different_encoding_containing_invalid_byte_sequence [/home/chkbuild/chkbuild/tmp/build/20210511T030005Z/ruby/test/irb/test_raise_no_backtrace_exception.rb:41]:
pid 221531 exit 0.

1. [1/2] Assertion for "stdout"
   | invalid byte sequence in US-ASCII.
```
2021-05-11 13:30:28 +09:00
Takashi Kokubun
bb54361057 [ruby/irb] Skip the new IRB test on Windows for now
It's not passing from the beginning
2550929220
39100747

71fc180018
2021-05-11 13:01:38 +09:00
aycabta
774cc32b4d [ruby/irb] Treat encodings in exception correctly
4452adbe04
2021-05-11 09:32:08 +09:00
aycabta
917050220a [ruby/irb] Use Exception#full_message to show backtrace in the correct order
[Bug #17466]

1c76845cca
2021-01-08 13:25:18 +09:00
aycabta
e72a6ed45f [ruby/irb] Escape invalid byte sequence in Exception
This fixes ruby/irb#141.

0815317d42
2021-01-05 18:05:06 +09:00
Benoit Daloze
336fe648b0 [ruby/irb] Skip the few failing tests on TruffleRuby
22717844c0
2020-12-17 20:23:27 +09:00
Steven Willis
9d2fed2ccd Don't echo results of assignment expressions 2019-08-16 06:02:45 +09:00
aycabta
43b52ac0a5 Revert "Don't echo results of assignment expressions"
This reverts commit 1ee88c51b3.
2019-08-06 20:28:48 +09:00
Steven Willis
1ee88c51b3 Don't echo results of assignment expressions 2019-08-06 20:15:07 +09:00
Takashi Kokubun
1808029061
make sync-default-gems GEM=irb
Upgrade IRB to 41ea43a4a7

Mostly backport changes.
2019-06-13 00:32:20 +09:00
Takashi Kokubun
9348643575
make sync-default-gems GEM=irb
Synced from 5feb361ed8.
This includes a support to colorize named Class instance on IRB inspect.
2019-04-27 22:01:11 +09:00
Takashi Kokubun
569c1ef6f1
make sync-default-gems GEM=irb
Backport changes from ruby/irb.
2019-04-27 11:42:40 +09:00
naruse
782e487260
suppress warning in test/irb
20190421T040003Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Re-committing 7f09b5e9da
2019-04-27 11:31:30 +09:00
Takashi Kokubun
52cfb17086
make sync-default-gems GEM=irb
from e6739d8c66
2019-04-26 18:28:57 +09:00
nobu
d9a01bc17a Remove unused variable and check if successed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 06:08:00 +00:00
naruse
7f09b5e9da suppress warning in test/irb
20190421T040003Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 05:48:35 +00:00
naruse
3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
akr
fb2008a73a * test/lib/envutil.rb: Moved from test/ruby/.
* test/lib/find_executable.rb: Ditto.

* test/lib/memory_status.rb: Ditto.

* test/lib/test/unit.rb: require envutil.

* test/: Don't require envutil in test files.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13 16:05:37 +00:00
hsbt
f741fd2d9d * lib/irb.rb: Prevent irb from crashing when exception with
nil backtrace is raised.
  [fix GH-434][ruby-core:58078][Bug #9063]
* test/irb/test_raise_no_backtrace_exception.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-13 02:19:48 +00:00