Skip to content

Commit 8dfb26b

Browse files
committed
test: update runner file and generate correct fixtures
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 30cf9c1 commit 8dfb26b

File tree

11 files changed

+30
-28
lines changed

11 files changed

+30
-28
lines changed

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/medium_negative.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/medium_negative_float32.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/medium_positive.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/medium_positive_float32.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/runner.jl

100644100755
Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,36 @@
1919
import JSON
2020

2121
"""
22-
gen( domain, filepath )
22+
gen( domain, name )
2323
2424
Generate fixture data and write to file.
2525
2626
# Arguments
2727
2828
* `domain`: domain
29-
* `filepath::AbstractString`: filepath of the output file
29+
* `name::AbstractString`: output filename
3030
3131
# Examples
3232
3333
``` julia
34-
julia> x = range( -100, stop = 100, length = 2001 );
35-
julia> gen( x, \"./data.json\" );
34+
julia> x = range( -1, stop = 1, length = 2001 );
35+
julia> gen( x, \"data.json\" );
3636
```
3737
"""
38-
function gen( domain, filepath )
38+
function gen( domain, name )
3939
x = collect( domain );
4040
y = exp.( x );
41+
42+
# Store data to be written to file as a collection:
4143
data = Dict([
4244
("x", x),
4345
("expected", y)
4446
]);
47+
48+
# Based on the script directory, create an output filepath:
49+
filepath = joinpath( dir, name );
50+
51+
# Write the data to the output filepath as JSON:
4552
outfile = open( filepath, "w" );
4653
write( outfile, JSON.json(data) );
4754
write( outfile, "\n" );
@@ -55,26 +62,21 @@ file = @__FILE__;
5562
dir = dirname( file );
5663

5764
# Medium negative values:
58-
x = Float32.(range( -86.9, stop = -0.3535, length = 1000 ));
59-
out = joinpath( dir, "./medium_negative_float32.json" );
60-
gen( x, out );
65+
x = Float32.( range( -88.721, stop = -1.0, length = 2000 ) );
66+
gen( x, "./medium_negative.json" );
6167

62-
# Medium positive_float32 values:
63-
x = Float32.(range( 0.3535, stop = 88.721, length = 1000 ));
64-
out = joinpath( dir, "./medium_positive_float32.json" );
65-
gen( x, out );
68+
# Medium positive values:
69+
x = Float32.( range( 1.0, stop = 88.721, length = 2000 ) );
70+
gen( x, "./medium_positive.json" );
6671

67-
# Small negative_float32 values:
68-
x = Float32.(range( -0.3535, stop = -2.0^-14, length = 1000 ));
69-
out = joinpath( dir, "./small_negative_float32.json" );
70-
gen( x, out );
72+
# Small negative values:
73+
x = Float32.( range( -1.0, stop = -2.0^-27, length = 2000 ) );
74+
gen( x, "./small_negative.json" );
7175

72-
# Small positive_float32 values:
73-
x = Float32.(range( 2.0^-14, stop = 0.3535, length = 1000 ));
74-
out = joinpath( dir, "./small_positive_float32.json" );
75-
gen( x, out );
76+
# Small positive values:
77+
x = Float32.( range( 2.0^-27, stop = 1.0, length = 2000 ) );
78+
gen( x, "./small_positive.json" );
7679

7780
# Tiny values:
78-
x = Float32.(range( -2.0^-14, stop = 2.0^-14, length = 1000 ));
79-
out = joinpath( dir, "./tiny_float32.json" );
80-
gen( x, out );
81+
x = Float32.( range( -2.0^-27, stop = 2.0^-27, length = 2000 ) );
82+
gen( x, "./tiny.json" );

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/small_negative.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/small_negative_float32.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/small_positive.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/small_positive_float32.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/node_modules/@stdlib/math/base/special/expf/test/fixtures/julia/tiny.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)