nushell/crates/nu-std/tests
Antoine Stevan ba6d8ad261
add std repeat command to replace "foo" * 3 (#10339)
related to
- https://github.com/nushell/nushell/issues/10233
- https://github.com/nushell/nushell/pull/10293
- https://github.com/nushell/nushell/pull/10292

inspired by @kubouch 

# Description
this PR adds a `repeat` command to the standard library

# User-Facing Changes
a new `repeat` command in `std`
```nushell
repeat anything a bunch of times, yielding a list of *n* times the input

# Examples
    repeat a string
    > "foo" | std repeat 3 | str join
    "foofoofoo"

Usage:
  > repeat <n>

Flags:
  -h, --help - Display the help message for this command

Parameters:
  n <int>: the number of repetitions, must be positive

Input/output types:
  ╭───┬───────┬───────────╮
  │ # │ input │  output   │
  ├───┼───────┼───────────┤
  │ 0 │ any   │ list<any> │
  ╰───┴───────┴───────────╯
```

# Tests + Formatting
a new test called `repeat_things` in `test_std.nu`

# After Submitting
2023-09-12 21:59:31 +02:00
..
logger_tests change LOG_FORMAT to NU_LOG_FORMAT in nu-std library (#10254) 2023-09-06 10:17:14 -07:00
test_asserts.nu Rename into decimal to into float (#9979) 2023-09-12 13:02:47 +02:00
test_dirs.nu Implement annotations support in test runner (#9406) 2023-07-02 10:41:33 +02:00
test_formats.nu add 'from ndjson' into standard library (#10283) 2023-09-11 14:59:07 +02:00
test_iter.nu Implement annotations support in test runner (#9406) 2023-07-02 10:41:33 +02:00
test_setup_teardown.nu Implement annotations support in test runner (#9406) 2023-07-02 10:41:33 +02:00
test_std.nu add std repeat command to replace "foo" * 3 (#10339) 2023-09-12 21:59:31 +02:00
test_xml.nu Implement annotations support in test runner (#9406) 2023-07-02 10:41:33 +02:00