nushell/crates/nu-protocol/tests
Simon Curtis f05162811c
Implementing ByteStream interuption on infinite stream (#13552)
# Description

This PR should address #13530 by explicitly handling ByteStreams. 

The issue can be replicated easily on linux by running:

```nushell
open /dev/urandom | into binary | bytes at ..10
```

Would leave the output hanging and with no way to cancel it, this was
likely because it was trying to collect the input stream and would not
complete.

I have also put in an error to say that using negative offsets for a
bytestream without a length cannot be used.

```nushell
~/git/nushell> open /dev/urandom | into binary | bytes at (-1)..
Error: nu:🐚:incorrect_value

  × Incorrect value.
   ╭─[entry #3:1:35]
 1 │ open /dev/urandom | into binary | bytes at (-1)..
   ·                                   ────┬─── ───┬──
   ·                                       │       ╰── encountered here
   ·                                       ╰── Negative range values cannot be used with streams that don't specify a length
   ╰────
   ```

# User-Facing Changes

No operation changes, only the warning you get back for negative offsets

# Tests + Formatting

Ran `toolkit check pr ` with no errors or warnings

Manual testing of the example commands above

---------

Co-authored-by: Ian Manske <ian.manske@pm.me>
Co-authored-by: Simon Curtis <simon.curtis@candc-uk.com>
2025-01-11 13:28:08 -08:00
..
pipeline Implementing ByteStream interuption on infinite stream (#13552) 2025-01-11 13:28:08 -08:00
into_config.rs Always load default env/config values (#14249) 2024-11-20 16:15:15 -06:00
mod.rs Implementing ByteStream interuption on infinite stream (#13552) 2025-01-11 13:28:08 -08:00
test_config.rs Add auto option for config.use_ansi_coloring (#14647) 2024-12-26 11:00:01 -06:00
test_pipeline_data.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
test_signature.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
test_value.rs add function to make env vars case-insensitive (#14390) 2024-12-03 20:47:58 -06:00