Commit 663c82a
fix(stdlib): builtins.map multi-iterable binding + add coverage for untested builtins (#292)
* test(stdlib): add coverage for untested builtins - abs, chr/ord, len, map, type conversions, isinstance, bytes
Adds 15 new [<Fact>] tests for builtins that were bound in Builtins.fs
but had no test coverage:
- abs (int and float)
- chr / ord (and round-trip)
- len (list and string)
- map (single and two-iterable overloads)
- str / int / float type conversions
- isinstance / type
- bytes (from byte array and from string with encoding)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(stdlib): fix len/map cases that hit binding limits
`len` on an F# `int list` fails because FSharpList has no `__len__`;
convert via `builtins.list` instead. Drop the two-iterable `map` case —
the binding's `'T1 * 'T2 -> 'T3` signature compiles to a tuple-input
function but Python's `map` calls `f(a, b)` positionally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(stdlib): builtins.map multi-iterable overloads use System.Func
The 2- and 3-iterable overloads typed the function as `'T1 * 'T2 -> 'T3`
(tuple-input), which Fable compiles to a Python function expecting a
single tuple arg. But Python's `map(f, it1, it2)` calls `f(a, b)`
positionally, so calls failed with "takes 1 positional argument but 2
were given". Switching to `System.Func<...>` produces a Python function
with the correct positional arity. Restores the two-iterable test and
adds a three-iterable test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dag Brattli <dag@brattli.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 05f2bea commit 663c82a
2 files changed
Lines changed: 107 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
0 commit comments