summaryrefslogtreecommitdiff
path: root/test/irb/test_completion.rb
AgeCommit message (Collapse)Author
2024-04-10[ruby/irb] Command implementation not by methodtomoya ishida
(https://github.com/ruby/irb/pull/824) * Command is not a method * Fix command test * Implement non-method command name completion * Add test for ExtendCommandBundle.def_extend_command * Add helper method install test * Remove spaces in command input parse * Remove command arg unquote in help command * Simplify Statement and handle execution in IRB::Irb * Tweak require, const name * Always install CommandBundle module to main object * Remove considering local variable in command or expression check * Remove unused method, tweak * Remove outdated comment for help command arg Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/irb/commit/8fb776e379 Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-01-26Try to use irb instead of rubygems for completion testHiroshi SHIBATA
I'm not sure why OpenBSD suggest `rubygems_plugin` file for this. https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20240126T013005Z.fail.html.gz It seems environmental issue, not irb.
2024-01-23Fixup 2e69137dbe9fd7c03dac9b8adc30a7eba3ecb10bHiroshi SHIBATA
2024-01-22Use version dependant library for completion testHiroshi SHIBATA
2024-01-03[ruby/irb] Avoid completing empty inputStan Lo
(https://github.com/ruby/irb/pull/832) The candidate list for empty input is all methods + all variables + all constants + all keywords. It's a long list that is not useful. https://github.com/ruby/irb/commit/812dc2df7b
2023-11-18[ruby/irb] Fix irb crash on `{}.` completiontomoya ishida
(https://github.com/ruby/irb/pull/764) https://github.com/ruby/irb/commit/07e4d540cc
2023-10-16[ruby/irb] Suppress "Switch to inspect mode" messagesNobuyoshi Nakada
This message is displayed if STDIN is not a tty. The parallel test is the case. https://github.com/ruby/irb/commit/e26e90e3fb
2023-10-14[ruby/irb] Restore encoding in InputCompletor testtomoya ishida
(https://github.com/ruby/irb/pull/732) https://github.com/ruby/irb/commit/ef77c232cf
2023-10-14[ruby/irb] Restore IRB::InputCompletor for compatibilitytomoya ishida
(https://github.com/ruby/irb/pull/730) https://github.com/ruby/irb/commit/77265efc5f
2023-10-12[ruby/irb] Fix require path completion disturbing string methodtomoya ishida
completion (https://github.com/ruby/irb/pull/726) https://github.com/ruby/irb/commit/e42dc74ce0
2023-10-12[ruby/irb] Fix test runner exit bugtomoya ishida
(https://github.com/ruby/irb/pull/728) * Remove useless test setup and teardown that sets MAIN_CONTEXT to nil * Avoid adding command methods to main object in test https://github.com/ruby/irb/commit/f204829a08
2023-10-11[ruby/irb] Rename current completor to RegexpCompletor andtomoya ishida
refactored for future extension (https://github.com/ruby/irb/pull/707) * Move completion implementation to completion/regexp_completor for future extension * Remove constant CompletionProc and PerfectMatchedProc and add a class method * Move document display logic to InputCompletor. Each completor only need to implement `completion_caididates` and `doc_namespace` * Move display_document logic to RelineInputMethod * Use RegexpCompletor directly. Not through class method of InputCompletor. * RegexpCompletor extends BaseCompletor, move back definition to completion.rb * Move display_document test to input_method test * Stop re-initialize completor on each completion phase * Store completor to ReadlineInputMethod's iver https://github.com/ruby/irb/commit/1e98521483
2023-06-13[ruby/irb] Stanardise test class names with `Test` postfix insteadStan Lo
of prefix (https://github.com/ruby/irb/pull/603) https://github.com/ruby/irb/commit/359cb28def
2023-06-13[ruby/irb] Use symbol.inspect instead of ":"+symbol.id2name to avoidtomoya ishida
completion candidates including newline characters (https://github.com/ruby/irb/pull/539) https://github.com/ruby/irb/commit/aaf0c46645
2023-06-05[ruby/irb] Fixed string escaping omissionsima1zumi
(https://github.com/ruby/irb/pull/599) I received a `RegexpError` when I typed `::Array[`. ::Array[/Users/mi/ghq/github.com/ruby/irb/lib/irb/completion.rb:236:in `retrieve_completion_data': premature end of char-class: /^Array[/ (RegexpError)
2023-03-06[ruby/irb] Improve method completion for string and regexp thattomoya ishida
includes word break characters (https://github.com/ruby/irb/pull/523) * Improve method completion for string and regexp that includes word break characters * Remove completion-test's assert_not_include because candidates no longer include every possible methods * Add comment about string's method completion regexp Co-authored-by: Stan Lo <stan001212@gmail.com> * Add comment about regexp's method completion regexp Co-authored-by: Stan Lo <stan001212@gmail.com> --------- https://github.com/ruby/irb/commit/aa8128c533 Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-04[ruby/irb] Drop chained methods' completion supportStan Lo
(https://github.com/ruby/irb/pull/529) Consider completion for this example: `foo.bar.b` Without type information, it is hard to know the return value of the `bar` method, so the current implementation interates through `ObjectSpace` to get all possible candidates for the second method. In small projects, the performance and accuracy are acceptable. But in bigger projects, the performance is unacceptable and the accuracy is mostly poor. So this commit drops the support for chained methods' completion.
2023-03-03[ruby/irb] Avoid slow symbol completion when completion target is antomoya ishida
empty symbol (https://github.com/ruby/irb/pull/534) https://github.com/ruby/irb/commit/35697f3ef3
2023-02-24[ruby/irb] Cleanup completion testsStan Lo
(https://github.com/ruby/irb/pull/520) * Remove redundant completion test The test case was introduced to guard an old implementation, which relied on `Module#name`. Commit: https://github.com/ruby/irb/commit/8827d182746396dbf4499c2c1c8c0e9bf8375b7c However, the current implementation has avoided calling `Module#name` completely, so the test case is no longer necessary. Commit: https://github.com/ruby/irb/commit/88311ce3c84251e6f420246cd14efc96e00888be * Remove unnecessary pend
2022-11-03[ruby/irb] Provide a base test class and let tests restore encodingsStan Lo
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. https://github.com/ruby/irb/commit/c2874ec121
2022-10-27[ruby/irb] Add missing require Stan Lo
2022-10-27[ruby/irb] Add test for IRB::InputCompletor::PerfectMatchedProcst0012
This proc displays rdoc document when the input matches certain symbols perfectly, like "String". It's commonly triggered with autocompletion but only has 1 test case. So this commit increases its test coverage. https://github.com/ruby/irb/commit/d85d719313
2022-10-08[ruby/irb] Sort constant completion's candidatesst0012
https://github.com/ruby/irb/commit/ee9b33c817
2022-10-08[ruby/irb] Correct assert_equal's usage in completion testsst0012
https://test-unit.github.io/test-unit/en/Test/Unit/Assertions.html#assert_equal-instance_method https://github.com/ruby/irb/commit/00f90d40ad
2022-10-08[ruby/irb] Add constant completion testst0012
https://github.com/ruby/irb/commit/39f8fcb058
2022-10-08[ruby/irb] Regroup completion testsst0012
https://github.com/ruby/irb/commit/71631287c8
2022-10-08[ruby/irb] Add tests for primitive types' method completionst0012
https://github.com/ruby/irb/commit/2e12fac38e
2022-10-05[ruby/irb] Fixed sort of variables in completionImir Kiyamov
https://github.com/ruby/irb/commit/5842888255
2022-10-03[ruby/irb] Change to explicit method call in completion ↵osyo-manga
(https://github.com/ruby/irb/pull/369) Ensure that methods are called even when local variables are defined. see: https://github.com/ruby/irb/issues/368 https://github.com/ruby/irb/commit/c34d54b8bb
2022-09-21[ruby/irb] Fix completion testsStan Lo
https://github.com/ruby/irb/commit/eb1691f636
2022-09-21[ruby/irb] Handle non-String $LOAD_PATH values more carefullyst0012
In addition to String values, $LOAD_PATH can also take objects that respond_to the `to_path` method, like Pathname objects. So `irb` should be able to handle those objects too. And if $LOAD_PATH contains objects that can't be converted into String, `irb` should simply ignore it. https://github.com/ruby/irb/commit/b2f562176b
2021-10-13[ruby/irb] Ignore parenthesis during completionKaíque Kandy Koga
Rename method https://github.com/ruby/irb/commit/619aecb412
2021-09-24Pend test_complete_require_library_name_firstaycabta
2021-09-23[ruby/irb] Ignore any encoding errors while symbol completionNobuyoshi Nakada
https://github.com/ruby/irb/commit/daa65cded1
2021-09-21[ruby/irb] Fix argument orderNobuyoshi Nakada
https://github.com/ruby/irb/commit/05c65858a0
2021-09-11[ruby/irb] Ignore invalid 3 colons in completionaycabta
https://github.com/ruby/irb/commit/5e29e3e39c
2021-09-08[ruby/irb] Use "csv" for testaycabta
The "csv" doesn't conflict with other stdlib names in any Ruby processing system. https://github.com/ruby/irb/commit/49203a1c83
2021-09-08[ruby/irb] Show lib name first because it's the most common use caseaycabta
https://github.com/ruby/irb/commit/74d635758b
2021-09-04[ruby/irb] Suppress "assigned but unused variable" warningaycabta
https://github.com/ruby/irb/commit/a1ddf64c69
2021-09-04[ruby/irb] Add an assertion to check completion "var.method" to get correct ↵aycabta
"class.method" https://github.com/ruby/irb/commit/cc1ddb37a9
2021-09-04[ruby/irb] Retrieve completed receiver that is a module or class correctlyaycabta
https://github.com/ruby/irb/commit/b2324727e1
2021-09-02[ruby/irb] Detect the variable class to show docaycabta
https://github.com/ruby/irb/commit/33b9bec954
2021-08-30[ruby/irb] Use pend instead of skipHiroshi SHIBATA
https://github.com/ruby/irb/commit/f441ce35bf
2021-03-25[ruby/irb] Cache completion files to requireaycabta
https://github.com/ruby/irb/commit/612ebcb311
2021-03-24[ruby/irb] fix completion test when out-of-place buildNobuyoshi Nakada
2021-03-24[ruby/irb] Complete require and require_relativeaycabta
https://github.com/ruby/irb/commit/1c61178b4c
2021-01-08should use `assert_include` here.Koichi Sasada
Random ordering test can introduce antoher candidate so it should be `assert_include`.
2021-01-08[ruby/irb] do not escape a predicate method for doc namespaceNobuhiro IMAI
* Fixes #88 https://github.com/ruby/irb/commit/d431a30af4
2020-02-15[ruby/irb] fix reserved words and completion for themNobuhiro IMAI
https://github.com/ruby/irb/commit/6184b227ad
2020-02-14test/irb/test_completion.rb: suppress a warning: unused literal ignoredYusuke Endoh