File: parse_quote_char_nil.yaml

package info (click to toggle)
ruby-csv 3.3.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 796 kB
  • sloc: ruby: 6,862; makefile: 4; sh: 4
file content (22 lines) | stat: -rw-r--r-- 618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
loop_count: 100
contexts:
  - gems:
      csv: 3.3.0
  - name: "master"
    prelude: |
      $LOAD_PATH.unshift(File.expand_path("lib"))
      require "csv"
prelude: |-
  n_columns = Integer(ENV.fetch("N_COLUMNS", "50"), 10)
  n_rows = Integer(ENV.fetch("N_ROWS", "1000"), 10)
  alphas = ["AAAAA"] * n_columns
  unquoted = (alphas.join(",") + "\r\n") * n_rows
  col_sep_space = (alphas.join(" ") + "\r\n") * n_rows

benchmark:
  without_quote_char: |-
    CSV.parse(unquoted)
  quote_char_nil: |-
    CSV.parse(unquoted, quote_char: nil)
  col_sep_space: |-
    CSV.parse(col_sep_space, quote_char: nil, col_sep: " ")