Skip to content

Commit

Permalink
adjust large tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Apr 26, 2024
1 parent 4c55b88 commit 7a96bbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions test/gleam/dict_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ pub fn insert_order_equality_test() {
|> should.equal(grow_and_shrink_map(4, 2))
grow_and_shrink_map(17, 10)
|> should.equal(grow_and_shrink_map(12, 10))
grow_and_shrink_map(2000, 1000)
|> should.equal(grow_and_shrink_map(1000, 1000))
// Nix doesn't have TCO
grow_and_shrink_map(200, 100)
|> should.equal(grow_and_shrink_map(100, 100))
}

// ensure operations on a map don't mutate it
Expand All @@ -265,10 +266,11 @@ pub fn persistence_test() {

// using maps as keys should work (tests hash function)
pub fn map_as_key_test() {
let l = range(0, 1000, [])
// Nix doesn't have TCO
let l = range(0, 100, [])
let a = list_to_map(l)
let a2 = list_to_map(list.reverse(l))
let a3 = grow_and_shrink_map(2000, 1000)
let a3 = grow_and_shrink_map(200, 100)
let b = grow_and_shrink_map(60, 50)
let c = grow_and_shrink_map(50, 20)
let d = grow_and_shrink_map(2, 2)
Expand Down Expand Up @@ -301,7 +303,8 @@ pub fn map_as_key_test() {
}

pub fn large_n_test() {
let n = 10_000
// Nix doesn't have TCO
let n = 100
let l = range(0, n, [])

let m = list_to_map(l)
Expand All @@ -312,7 +315,7 @@ pub fn large_n_test() {
}

pub fn size_test() {
let n = 1000
let n = 100
let m = list_to_map(range(0, n, []))
dict.size(m)
|> should.equal(n)
Expand Down
2 changes: 1 addition & 1 deletion test/gleam/list_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const recursion_test_cycles = 40_000
// We would normally input 40_000 here for the tests, therefore.
// However, Nix does not have TCO, unfortunately.
@target(nix)
const recursion_test_cycles = 1
const recursion_test_cycles = 10

pub fn length_test() {
list.length([])
Expand Down

0 comments on commit 7a96bbc

Please sign in to comment.