Commit graph

106 commits

Author SHA1 Message Date
aycabta
4a620aff8d Restore class variable setting for tests 2020-05-14 12:27:33 +09:00
aycabta
978e691c86 Restore Readline.completion_case_fold in test 2020-05-14 12:27:33 +09:00
aycabta
b621c9abd1 Set Readline.completion_append_character = nil always
GNU Readline add a white space when Readline.completion_append_character is
not initialized.
2020-02-29 03:32:36 +09:00
Koichi Sasada
f7be85a2b7 support random order test.
test_readline:
  HISTORY should be empty.

test_using_quoting_detection_proc:
test_using_quoting_detection_proc_with_multibyte_input:
  Readline.completer_quote_characters= and
  Readline.completer_word_break_characters= doesn't accept nil,
  so skip if previous values are nil.
2020-02-28 23:32:56 +09:00
aycabta
6df8cfb771 Omit test_using_quoting_detection_proc_with_multibyte_input temporarily for random order test 2020-02-28 19:28:11 +09:00
MSP-Greg
da31035687 test/readline - allow ENV control of test class creation
In ruby/ruby, the tests run on both readline & reline by creating four test classes:
```
TestReadline
TestReadlineHistory

TestRelineAsReadline
TestRelineAsReadlineHistory
```

Reline inports the test files and uses them in its CI.  Adding the ENV control allows it to only run the `TestRelineAsReadline` classes.
2020-02-22 10:01:09 +09:00
S-H-GAMELINKS
5fd5666dcc support multi-run test for test_readline.rb 2020-02-19 13:47:33 +09:00
aycabta
ac0658e720 [ruby/readline-ext] Check TestRelineAsReadline existance
c0a6303168
2020-02-09 20:22:12 +09:00
Lars Kanis
7a51d979cf
Fix inaccuracy in encoding tests
These tests assume
  Encoding.find('locale') == Encoding.find('external')
and fail if they are distinct.
2020-02-04 08:24:59 +09:00
aycabta
890200e85e Check DONT_RUN_RELINE_TEST envvar 2020-01-23 13:35:45 +09:00
aycabta
0d3e4b8a79 Use omit instead of skip 2020-01-23 13:31:19 +09:00
aycabta
f09c1cf0e9 Skip a test that uses assert_ruby_status if it doesn't exist 2020-01-23 13:31:19 +09:00
aycabta
a737f0cea5 Stop using minitest dependent methods 2020-01-23 13:31:19 +09:00
Lars Kanis
b0ca1fc21b Reline: Fix changed test results due to change to UTF-8 on Windows
In commit f8ea2860b0 the Reline encoding
for native windows console was changed to hardcoded UTF-8.
This caused failures in reline and readline tests, but they were hidden,
because parallel ruby tests incorrectly used Reline::ANSI as IOGate.
Tests failures were raised in single process mode, but not with -j switch.

This patch corrects encodings on native Windows console.
2020-01-21 21:26:58 +09:00
MSP-Greg
d912393e09 text/readline/test_readline.rb - fix skip on Reline (#2743)
TestRelineAsReadline#test_input_metachar passes on MinGW
2019-12-31 00:29:58 -08:00
aycabta
64ce658ec5 Fix return condition according to the condition to skip 2019-12-17 13:30:54 +09:00
aycabta
95213f6df6 Check wether Readline.completion_append_character= exists 2019-12-17 05:08:09 +09:00
aycabta
69b6f8fd04 Check wether TestReadline is defined 2019-12-13 00:04:44 +09:00
aycabta
51cc5a26df Some tests failed with before GNU Readline 6.0 on Windows 2019-12-12 03:19:09 +09:00
aycabta
c2f6aa4e48 The result of Readline.completion_proc should have the same encoding of Encoding.default_external 2019-12-11 19:39:37 +09:00
Koichi Sasada
eb9c007053 skip continuous failure test.
On mingw this test fails and not solved long time, so skip it.
Please revert it when it solved.

29458671/job/9nbcjnfe6p0xnxoe
2019-12-11 16:49:08 +09:00
aycabta
07664f3aec Remove workaround encoding modification 2019-12-09 14:21:20 +09:00
aycabta
0d63a21047 Skip completion tests for Editline 2019-12-08 18:29:39 +09:00
aycabta
c38bc172be Fix encoding of completed list 2019-12-08 08:35:31 +09:00
aycabta
c9b06d4a4e Add test_simple_completion for Readline 2019-12-08 08:01:27 +09:00
Jeremy Evans
ab42e5a486 More fixes for $SAFE/taint post merging 2019-11-18 01:00:25 +02:00
Jeremy Evans
ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans
c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
aycabta
6aacef4948 Assert return value of Readline.readline only if Ruby is before 2.7 2019-11-05 21:06:29 +09:00
Jeremy Evans
a50bc9f3c8 Do not always taint the result of File#path
The result should only be tainted if the path given to the method
was tainted.

The code to always taint the result was added in
a4934a42cb (svn revision 4892) in
2003 by matz.  However, the change wasn't mentioned in the
commit message, and it may have been committed by accident.

Skip part of a readline test that uses Reline.  Reline in general
would pass the test, but Reline's test mode doesn't raise a
SecurityError if passing a tainted prompt and $SAFE >= 1. This
was hidden earlier because File#path was always returning a
tainted string.

Fixes [Bug #14485]
2019-07-30 11:55:59 -07:00
Jeremy Evans
6eab49a40a Revert "Do not always taint the result of File#path"
This reverts commit 1a759bfe5d.

This fails on some operating systems.
2019-07-29 12:10:15 -07:00
Jeremy Evans
1a759bfe5d Do not always taint the result of File#path
The result should only be tainted if the path given to the method
was tainted.

The code to always taint the result was added in
a4934a42cb (svn revision 4892) in
2003 by matz.  However, the change wasn't mentioned in the
commit message, and it may have been committed by accident.

Skip part of a readline test that uses Reline.  Reline in general
would pass the test, but Reline's test mode doesn't raise a
SecurityError if passing a tainted prompt and $SAFE >= 1. This
was hidden earlier because File#path was always returning a
tainted string.

Fixes [Bug #14485]
2019-07-29 10:45:14 -07:00
Takashi Kokubun
98ba116d40
Revert 3b7862c8e8 causing various CI hangs
and dependent commits c67934b1c3 and
f0d1dc5cee.

RubyCI and ci.rvm.jp are almost dead by timeout since this commit.

---

Revert "Skip a reline test hanging on Wercker since 3b7862c8e8"

This reverts commit f0d1dc5cee.

Revert "Remove extra items because Reline::HISTORY is a sized queue"

This reverts commit c67934b1c3.

Revert "Use existing instances for LineEditor and Config"

This reverts commit 3b7862c8e8.
2019-05-29 09:05:26 +09:00
Takashi Kokubun
f0d1dc5cee
Skip a reline test hanging on Wercker since 3b7862c8e8
like 5cedad1110
2019-05-29 08:08:54 +09:00
Jeremy Evans
f91b1ab33d Skip assertion in readline test if Readline version is 4.3
Previously, the entire method was not run for Readline 4.3, probably
because it was known to fail. Commit
c754e979d3 removed the check for
Readline 4.3.  Other than this one assertion, which also doesn't
work when using Reline, the method runs correctly when using
Readline 4.3.

Fixes [Bug #15853].
2019-05-22 21:32:31 -07:00
aycabta
c754e979d3 Test ext/readline and lib/reline by test/readline 2019-05-14 15:37:45 +09:00
aycabta
07e7ae9ed7 Add an assertion message to test of Readline's class variables 2019-05-14 15:37:17 +09:00
aycabta
24964fff92 Check that Reline exists on test 2019-05-13 04:22:15 +09:00
aycabta
75f196ce75 Skip tests depend on Readline's special behaviors 2019-05-13 03:29:18 +09:00
NAKAMURA Usaku
830e40ee05
Skip on Windows now when using reline because it causes hang of whole tests 2019-04-30 19:45:44 +09:00
k0kubun
0bbf1eb754 test_readline.rb: skip readline test for new solaris11s-sunc
for now. This should be fixed, but let me make this new CI green
first to introduce Solaris-related changes later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 14:24:46 +00:00
nobu
074f1c9133 Readline: expose rl_completion_quote_character variable
[Feature #13050]

From: georgebrock (George Brocklehurst) <ruby@georgebrock.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-02 23:27:08 +00:00
k0kubun
6264225c7e test/readline/test_readline.rb: fix readline test
for mingw.

test/lib/minitest/unit.rb: Add 'guards' for mingw.
Removed still-unused method `mswin?` from original patch.

[Fix GH-1941]

From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-23 23:50:48 +00:00
k0kubun
4940bbc791 test_readline.rb: skip teardown failure
https://ci.appveyor.com/project/ruby/ruby/build/9271/job/e88212s136mr0dgr

I'll take a look at MSP-Greg's patch on readline later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 03:03:18 +00:00
k0kubun
0c95c744ce skip tests failing on AppVeyor MinGW
Let me skip this to make CI green first and take a look later...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15 01:40:57 +00:00
ko1
c39bdb798d $SAFE as a process global state. [Feature #14250]
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to
  `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state.

* vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc`
  objects don't need to keep `$SAFE` at the creation.
  Also make `is_from_method` and `is_lambda` as 1 bit fields.

* cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation.

* eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access
  `vm->safe_level_` directly.

* eval_jump.c: End procs `END{}` doesn't keep `$SAFE`.

* proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c.

* safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes.

* safe.c (safe_setter): use `rb_set_safe_level()`.

* thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`.
  It should be obsolete.

* transcode.c (load_transcoder_entry): `rb_safe_level()` only returns
  0 or 1 so that this check is not needed.

* vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc.

* vm.c (rb_proc_create): renamed to `proc_create`.

* vm.c (rb_proc_dup): moved from proc.c.

* vm.c (vm_invoke_proc): do not need to set and restore `$SAFE`
  for `Proc#call`.

* vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer
  meaning.

* lib/drb/drb.rb: restore `$SAFE`.

* lib/erb.rb: restore `$SAFE`, too.

* test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests.

* test/rubygems/test_gem.rb: do not set `$SAFE = 1`.

* bootstraptest/test_proc.rb: catch up this change.

* spec/ruby/optional/capi/string_spec.rb: ditto.

* test/bigdecimal/test_bigdecimal.rb: ditto.

* test/fiddle/test_func.rb: ditto.

* test/fiddle/test_handle.rb: ditto.

* test/net/imap/test_imap_response_parser.rb: ditto.

* test/pathname/test_pathname.rb: ditto.

* test/readline/test_readline.rb: ditto.

* test/ruby/test_file.rb: ditto.

* test/ruby/test_optimization.rb: ditto.

* test/ruby/test_proc.rb: ditto.

* test/ruby/test_require.rb: ditto.

* test/ruby/test_thread.rb: ditto.

* test/rubygems/test_gem_specification.rb: ditto.

* test/test_tempfile.rb: ditto.

* test/test_tmpdir.rb: ditto.

* test/win32ole/test_win32ole.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28 20:09:24 +00:00
eregon
15689ed778 Fix test-all tests to avoid creating report_on_exception warnings
* The warnings are shown by Thread.report_on_exception defaulting to
  true. [Feature #14143] [ruby-core:83979]
* Improves tests by narrowing down the scope where an exception
  is expected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 18:44:49 +00:00
naruse
e999899e4e suppress warning: assigned but unused variable - line
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-15 21:36:16 +00:00
naruse
1d88e7b5a6 suppress warning: assigned but unused variable - line
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-15 13:05:18 +00:00
shugo
f7d130f473 Supress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 01:22:05 +00:00