Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up Python testing #56

Merged
merged 5 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ gleam_stdlib = ">= 0.34.0 and < 2.0.0"
startest = ">= 0.5.0 and < 1.0.0"
simplifile = ">= 2.2.0 and < 3.0.0"
shellout = ">= 1.6.0 and < 2.0.0"
gleam_json = ">= 1.0.1 and < 2.0.0"
1 change: 1 addition & 0 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ packages = [
]

[requirements]
gleam_json = { version = ">= 1.0.1 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
shellout = { version = ">= 1.6.0 and < 2.0.0" }
simplifile = { version = ">= 2.2.0 and < 3.0.0" }
Expand Down
17 changes: 15 additions & 2 deletions test/data.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ import data/float/valid_float_data
import data/integer/invalid_integer_data
import data/integer/valid_integer_data
import gleam/list
import python/python_parse
import test_data.{type FloatTestData, type IntegerTestData}

pub fn float_data() -> List(FloatTestData) {
pub fn float_test_data() -> List(FloatTestData) {
[valid_float_data.data(), invalid_float_data.data()]
|> list.flatten
}

pub fn integer_data() -> List(IntegerTestData) {
pub fn integer_test_data() -> List(IntegerTestData) {
[valid_integer_data.data(), invalid_integer_data.data()]
|> list.flatten
}

pub fn python_processed_float_data() {
let float_test_data = float_test_data()
let processed_values = python_parse.to_floats(float_test_data)
float_test_data |> list.zip(processed_values)
}

pub fn python_processed_integer_data() {
let integer_test_data = integer_test_data()
let processed_values = python_parse.to_ints(integer_test_data)
integer_test_data |> list.zip(processed_values)
}
Loading