Skip to content

Commit c0d3df3

Browse files
committed
Consolidate DELTA constant in test_helper.rb
1 parent 8d69fda commit c0d3df3

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

Diff for: test/dataanalysis_test.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative 'test_helper'
22

3-
DELTA = 1e-5
4-
53
class AlglibDataAnalysisTest < Test::Unit::TestCase
64
def test_sample_mean
75
s2 = r(<<~R)

Diff for: test/statistics_test.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require_relative 'test_helper'
22

3-
DELTA = 1e-5
4-
53
class AlglibStatisticsTest < Test::Unit::TestCase
64
def test_sample_mean
75
assert_equal r('mean(c(1, 2))').to_f, Alglib.sample_mean([1, 2])

Diff for: test/test_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
require 'open3'
66
require 'test-unit'
77

8+
DELTA = 1e-5
9+
810
# Run code in Rscript
911
def r(*code)
1012
cmd = "Rscript #{code.map { |c| "-e '#{c}'" }.join(' ')}"

0 commit comments

Comments
 (0)