Skip to content

Commit

Permalink
Merge branch 'master' into floitsch/name-error
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Feb 3, 2025
2 parents 7b26bb1 + 3741724 commit f58f39a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

on:
schedule:
- cron: '00 2 * * *' # 02:00 UTC
Expand Down
13 changes: 13 additions & 0 deletions lib/core/collections.toit
Original file line number Diff line number Diff line change
Expand Up @@ -3200,6 +3200,19 @@ class Map extends HashedInsertionOrderedCollection_:
The $block is invoked with two arguments for each entry in this instance:
the key and the value. The returned value becomes the new value for the key.
# Examples
```
map := { "a": 1, "b": 2 }
// Double the values. (Key is not used).
doubled := map.map: | _ value | value * 2
print doubled // => { "a": 2, "b": 4 }
// Prefix the values with the key.
prefixed := map.map: | key value | "$key-$value"
print prefixed // => { "a": "a-1", "b": "b-2" }
```
*/
map [block] -> Map:
result := Map
Expand Down
2 changes: 1 addition & 1 deletion tests/dns-tools-test.toit
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ txt-test network/net.Client:
]
texts := client.get --record-type=dns.RECORD-TXT --network=network "toit.io"
expect
texts.size == 0
texts.size == 1
ptr := client.get --record-type=dns.RECORD-PTR --network=network "toit.io"
expect
ptr.size == 0
Expand Down

0 comments on commit f58f39a

Please sign in to comment.