summaryrefslogtreecommitdiff
path: root/test/csv
AgeCommit message (Collapse)Author
2024-01-22Extract csvHiroshi SHIBATA
2023-10-03[ruby/csv] Add CSV::InvalidEncodingErrorKosuke Shibata
(https://github.com/ruby/csv/pull/287) To handle encoding errors in CSV parsing with the appropriate error class https://github.com/ruby/csv/commit/68b44887e5
2023-06-28[ruby/csv] Fix a bug that the same line is used multiple timesSutou Kouhei
GitHub: fix https://github.com/ruby/csv/pull/279 It's happen when: * `keep_start`/`keep_{drop,back}` are nested. (e.g.: `strip: true, skip_lines: /.../`) * Row separator is `\r\n`. * `InputScanner` is used. (Small input doesn't use `InputScanner`) Reported by Gabriel Nagy. Thanks!!! https://github.com/ruby/csv/commit/183635ab56
2023-05-25[ruby/csv] Support RJIT (https://github.com/ruby/csv/pull/281)Nobuyoshi Nakada
In Ruby 3.3, MJIT is replaced with RJIT. https://github.com/ruby/csv/commit/cc6b47a4a7 Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-05-25[ruby/csv] test: rename Helper to CSVHelperLuke Gruber
(https://github.com/ruby/csv/pull/278) Rename it so that in ruby/ruby, the generic name Helper is not used. Notes: Merged: https://github.com/ruby/ruby/pull/7851
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-02-21[ruby/csv] test: use mailing list ID instead of unavailable URLSutou Kouhei
https://github.com/ruby/csv/commit/04862ccf87
2023-02-21[ruby/csv] Use https links instead of httpVivek Bharath Akupatni
(https://github.com/ruby/csv/pull/274) https://github.com/ruby/csv/commit/e2a06929a8
2022-12-09Reapply the following commits related to extend timeout value.Hiroshi SHIBATA
66d1900423e6fb9774c2fe72dba8c2968b54d7ab 0686e4181d04dd911316a227753ceaa96d8c6533 1a63468831524f68e73cbb068071652c6486cfc6 e1fee7f949cb6719122672fa1081c60984a5339f 232e43fd52e53f667c2c290cffb4afa524889f0f Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-09Merge csv-3.2.6Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-08-29Respect RUBY_TESTOPTS on test-all (https://github.com/Shopify/ruby/pull/435)Takashi Kokubun
* Respect RUBY_TESTOPTS on test-all * Increase the Cirrus timeout * Increase the CSV test timeout Notes: Merged: https://github.com/ruby/ruby/pull/6289
2021-12-24[ruby/csv] test: reduce size for stability on GitHub ActionsSutou Kouhei
https://github.com/ruby/csv/commit/68461aead5 Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] Revert "parser: fix a keep bug that some texts may be dropped ↵Sutou Kouhei
unexpectedly" This reverts commit https://github.com/ruby/csv/commit/5c6523da0a61. This introduces another pbolem. We should try again later. https://github.com/ruby/csv/commit/43a1d6fff1 Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] parser: fix a keep bug that some texts may be dropped unexpectedlySutou Kouhei
Ruby: [Bug #18245] [ruby-core:105587] Reported by Hassan Abdul Rehman. https://github.com/ruby/csv/commit/5c6523da0a Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] Add handling for ambiguous parsing options ↵adamroyjones
(https://github.com/ruby/csv/pull/226) GitHub: fix GH-225 With Ruby 3.0.2 and csv 3.2.1, the file ```ruby require "csv" File.open("example.tsv", "w") { |f| f.puts("foo\t\tbar") } CSV.read("example.tsv", col_sep: "\t", strip: true) ``` produces the error ``` lib/csv/parser.rb:935:in `parse_quotable_robust': TODO: Meaningful message in line 1. (CSV::MalformedCSVError) ``` However, the CSV in this example is not malformed; instead, ambiguous options were provided to the parser. It is not obvious (to me) whether the string should be parsed as - `["foo\t\tbar"]`, - `["foo", "bar"]`, - `["foo", "", "bar"]`, or - `["foo", nil, "bar"]`. This commit adds code that raises an exception when this situation is encountered. Specifically, it checks if the column separator either ends with or starts with the characters that would be stripped away. This commit also adds unit tests and updates the documentation. https://github.com/ruby/csv/commit/cc317dd42d Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-24[ruby/csv] Fix typos [ci skip] (https://github.com/ruby/csv/pull/224)Nobuyoshi Nakada
https://github.com/ruby/csv/commit/27c0b66c8f Notes: Merged: https://github.com/ruby/ruby/pull/5336
2021-12-13Prepare for removing RubyVM::JIT (#5262)Takashi Kokubun
Notes: Merged-By: k0kubun <[email protected]>
2021-10-24[ruby/csv] Add support for Ractor (https://github.com/ruby/csv/pull/218)rm155
https://github.com/ruby/csv/commit/a802690e11 Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] CSV(): Add support for Ruby 3 (https://github.com/ruby/csv/pull/215)Anthony Hernandez
The implementation of the `CSV` shortcut method is broken in Ruby 3 for calls that look like this: ```ruby CSV(write_stream, col_sep: "|", headers: headers, write_headers: true) do |csv| ... end ``` The above will result in the following error when the `CSV` method attempts to pass on arguments to `CSV#instance`: ``` ArgumentError: wrong number of arguments (given 2, expected 0..1) ``` The issue is due to the changes in Ruby 3 relating to positional & keyword arguments. This commit updates the `CSV()` shortcut implementation to work with Ruby 3, and also updates the documentation for the shortcut method. https://github.com/ruby/csv/commit/310dee45fa Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-10-24[ruby/csv] Changed line ending handling to consider the combination \r\n as ↵Joakim Antman
a single entry when row is faulty (https://github.com/ruby/csv/pull/220) https://github.com/ruby/csv/commit/29cef9ea9d Notes: Merged: https://github.com/ruby/ruby/pull/5010
2021-01-13Rename RubyVM::MJIT to RubyVM::JITTakashi Kokubun
because the name "MJIT" is an internal code name, it's inconsistent with --jit while they are related to each other, and I want to discourage future JIT implementation-specific (e.g. MJIT-specific) APIs by this rename. [Feature #17490]
2020-11-24[ruby/csv] Add support for \r\n with skip_lines: /...$/ againSutou Kouhei
GitHub: fix GH-194 Reported by Josef Šimánek. Thanks!!! https://github.com/ruby/csv/commit/fd86afe081 Notes: Merged: https://github.com/ruby/ruby/pull/3804
2020-11-24[ruby/csv] Fix CSV.filter to preserve headers (#174)Burdette Lamar
Co-authored-by: Sutou Kouhei <[email protected]> https://github.com/ruby/csv/commit/203c5e0574 Notes: Merged: https://github.com/ruby/ruby/pull/3804
2020-07-20[ruby/csv] CSV.generate_line: use the encoding of the first non ASCII field ↵Sutou Kouhei
as the expected encoding See also: https://github.com/ruby/stringio/issues/13#issuecomment-660543554 https://github.com/ruby/csv/commit/004cf49d18 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] force_quotes: add support for specifying the target indexes or namesSutou Kouhei
GitHub: fix GH-153 Reported by Aleksandr. Thanks!!! https://github.com/ruby/csv/commit/8812c58a26 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Add `invalid: :replace` for `CSV.open` (#130)Koichi ITO
This PR adds `invalid: :replace` for `CSV.open`. It is a PR similar to #129. https://github.com/ruby/csv/commit/5bf687341c Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Fix an error for `CSV.open` (#131)Koichi ITO
Follow up to https://github.com/ruby/csv/pull/130/files#r434885191. This PR fixes `ArgumentError` for `CSV.open` when processing invalid byte sequence in UTF-8. https://github.com/ruby/csv/commit/a4b528c209 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Add `undef: :replace` for `CSV.open` (#129)Koichi ITO
This PR adds `undef: :replace` option for `CSV.open`. `File.open` has `undef: :replace` option, but `CSV.open` does not. It would be convenient if `CSV.open` could have a shortcut by having `undef: :replace` option. https://github.com/ruby/csv/commit/cff8b18480 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work ↵Sutou Kouhei
with non String GitHub: fix GH-123 Reported by asm256. Thanks!!! https://github.com/ruby/csv/commit/b4492139be Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Revert "test: use binary mode explicitly for Ruby 2.7"Sutou Kouhei
This reverts commit 736174d28413a4c36630b0daf2f170c8d2fc9abe. It doesn't solve anything. https://github.com/ruby/csv/commit/0ee3bdd0d3 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] test: use binary mode explicitly for Ruby 2.7Sutou Kouhei
https://github.com/ruby/csv/commit/736174d284 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Fix a parse bug when split character exists in middle of column valueSutou Kouhei
GitHub: fix #115 Reported by TOMITA Masahiro. Thanks!!! https://github.com/ruby/csv/commit/398b3564c5 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Ensuring StringIO's encoding in CSV.generate (#111)Seiei Miyagi
https://github.com/ruby/csv/commit/dbf55ef008 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Do not loop forever when skip_lines regexp matches zero length ↵Mike MacDonald
with anchors (#110) * Do not loop forever when skip_lines regexp matches zero length with anchors * Remove needless white spaces * Add missing eos check in skip_needless_lines * Simplify test https://github.com/ruby/csv/commit/3b15d4a3e8 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Make CSV::Row#dup return a usable Row (#108)Jim Kane
* Make CSV::Row#dup return a usable Row Previously, calling `dup` on a `CSV::Row` object yielded an object whose copy was too shallow. Changing the clone's fields would also change the fields on the source. This change makes the clone more distinct from the source, so that changes can be made to its fields without affecting the source. * Simplify https://github.com/ruby/csv/commit/64a1ea06fc Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20[ruby/csv] Suppress warningsSutou Kouhei
https://github.com/ruby/csv/commit/b37df55f46 Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-07-20Revert "test/csv/write/test_general.rb: suppress warnings"Nobuyoshi Nakada
This reverts commit 375cf129189f32f7be76ac525035bcde691a63e7, to sync csv from the upstream. Notes: Merged: https://github.com/ruby/ruby/pull/3332
2020-05-14Removed trailing spaces [ci skip]Nobuyoshi Nakada
2020-02-26Fixed for older versionsNobuyoshi Nakada
Fix up 66d1900423e6fb9774c2fe72dba8c2968b54d7ab, `RubyVM::MJIT` is available since ruby 2.6.
2020-02-25Increase timeout for CSV test with --jit-waitTakashi Kokubun
To prevent CI failures like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2739995
2019-11-09Remove unneeded exec bits from some filesDavid Rodríguez
I noticed that some files in rubygems were executable, and I could think of no reason why they should be. In general, I think ruby files should never have the executable bit set unless they include a shebang, so I run the following command over the whole repo: ```bash find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \; ``` Notes: Merged: https://github.com/ruby/ruby/pull/2662
2019-10-15test/csv/write/test_general.rb: suppress warningsYusuke Endoh
of "setting Encoding.default_internal".
2019-10-12Import CSV 3.1.2 (#2547)Sutou Kouhei
Notes: Merged-By: kou <[email protected]>
2019-09-06Fix keyword argument warnings in the tests from Class#newJeremy Evans
This were previously hidden because calls from C were not warned. Notes: Merged: https://github.com/ruby/ruby/pull/2432
2019-08-30Fix remaining warning issues in the tests due to keyword argument separationJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2395
2019-08-30Fix keyword argument separation warnings in testJeremy Evans
Notes: Merged: https://github.com/ruby/ruby/pull/2395
2019-08-08Aliases capture_output to capture_io for test-unit compatiblity.Hiroshi SHIBATA
2019-07-14[ruby/csv] Fix a bug that strip: true removes newlinesKouhei Sutou
https://github.com/ruby/csv/commit/5540d35a30
2019-07-14[ruby/csv] Don't raise on eof?Kouhei Sutou
GitHub: fix #86 Reported by krororo. Thanks!!! https://github.com/ruby/csv/commit/5a8d9d9297
2019-07-09Restore support library for only test files that are digest and csv.Hiroshi SHIBATA