Skip to content

Commit

Permalink
test quora: reduce checking (#190)
Browse files Browse the repository at this point in the history
Because tsv file is too big(404,290 rows).

Before this change:

```bash
$ time ruby -I lib test/run-test.rb -t "/QuoraDuplicateQuestionPairTest/" -v
Loaded suite test
Started
QuoraDuplicateQuestionPairTest:
  test: #each:                                                         .: (17.476536)

Finished in 17.476912 seconds.
-------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------
0.06 tests/s, 0.06 assertions/s

real    0m18.117s
user    0m17.554s
sys     0m0.383s
```

After this change:

```bash
$ time ruby -I lib test/run-test.rb -t "/QuoraDuplicateQuestionPairTest/" -v
Loaded suite test
Started
QuoraDuplicateQuestionPairTest:
  test: #each:                                                          .: (0.001124)

Finished in 0.001461 seconds.
-------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------
684.46 tests/s, 684.46 assertions/s

real    0m0.595s
user    0m0.376s
sys     0m0.126s
```

Refs #188.

---------

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
  • Loading branch information
tikkss and kou committed Jan 20, 2024
1 parent 3f33534 commit 37e2f35
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions test/test-quora-duplicate-question-pair.rb
Expand Up @@ -8,26 +8,12 @@ def record(*args)
end

test("#each") do
records = @dataset.each.to_a
assert_equal([
404290,
record(0,
1,
2,
"What is the step by step guide to invest in share market in india?",
"What is the step by step guide to invest in share market?",
false),
record(404289,
537932,
537933,
"What is like to have sex with cousin?",
"What is it like to have sex with your cousin?",
false),
],
[
records.size,
records.first,
records.last,
])
assert_equal(record(0,
1,
2,
"What is the step by step guide to invest in share market in india?",
"What is the step by step guide to invest in share market?",
false),
@dataset.each.next)
end
end

0 comments on commit 37e2f35

Please sign in to comment.