Skip to content

Commit

Permalink
fix tests, improve changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
inoas authored and lpil committed Jun 2, 2024
1 parent aa3bf69 commit 5ccf68f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
- Fixed a bug where `string.inspect` would use the incorrect syntax for unicode
escape codes on JavaScript.
- The `list` module gains the `count` function.
- The `dict` module function `update` has been deprecated in favour of `upsert`
and `update` will be used with a different signature in future.
- The `update` function of the `dict` module has been deprecated in favour
of `upsert` and `update` will be used with a different signature in future.

## v0.38.0 - 2024-05-24

Expand Down
8 changes: 4 additions & 4 deletions test/gleam/dict_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub fn delete_test() {
|> should.equal(dict.from_list([#("b", 1), #("c", 2)]))
}

pub fn update_test() {
pub fn upsert_test() {
let dict = dict.from_list([#("a", 0), #("b", 1), #("c", 2)])

let inc_or_zero = fn(x) {
Expand All @@ -187,15 +187,15 @@ pub fn update_test() {
}

dict
|> dict.update("a", inc_or_zero)
|> dict.upsert("a", inc_or_zero)
|> should.equal(dict.from_list([#("a", 1), #("b", 1), #("c", 2)]))

dict
|> dict.update("b", inc_or_zero)
|> dict.upsert("b", inc_or_zero)
|> should.equal(dict.from_list([#("a", 0), #("b", 2), #("c", 2)]))

dict
|> dict.update("z", inc_or_zero)
|> dict.upsert("z", inc_or_zero)
|> should.equal(dict.from_list([#("a", 0), #("b", 1), #("c", 2), #("z", 0)]))
}

Expand Down

0 comments on commit 5ccf68f

Please sign in to comment.