Files
janet/test
Pietro Cerutti 0bfcc9fc97 Fix a couple of imprecisions in the file/ docs (#1848)
* Fix a couple of imprecisions in the file/ docs

The `+` flag to `(file/open)` was incorrectly documented as being for
appending. Instead, this allows to read to files opened with `:w` or
`:a`, and to write to files opened with `:r`. This is the same as the
`+` flag in `fopen(3)`.

The `(file/seek)` function was documented as having both `whence` and
`n` as optional arguments. It also didn't say what the default for `n`
was. Anyway, this doesn't make sense, as a default of `:cur` and `0`
would effectively make `(file/seek f)` a no-op. I also amended a test so
both `(file/seek f :set 0)` and `(file/seek f :set)` are covered and
checked to move to the beginning of the file.

* Remove useless check for argc >= 2

We already determined it is between 2 and 3 with `janet_arity(argc, 2, 3)`.

* Dump args in assertion

* Unroll loop in test

* Differentiate failure messages
2026-09-10 17:12:54 -05:00
..
2026-08-30 10:49:05 -05:00
2026-04-03 08:38:12 -05:00