Commit Graph

115 Commits

Author SHA1 Message Date
Hristo Filaretov
7710317224
Add known external tests (#5216)
* Add known external tests

* Add some documentation to the tests

* Document test_hello example

* Set PWD in run_test
2022-04-17 05:39:56 -05:00
Boy van Duuren
594006cfa0
Fix failing unit tests on Windows (#5142) (#5143)
* Fix failing unit tests on Windows (#5142)

Fix let_env_expressions failing on Windows:
The env expression uses PATH, but on windows Path is used.

Fix correctly_escape_external_arguments, execute_binary_in_string
failing on Windows:
Using cococo now to make sure testresults are platform independent

* Update macros.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-04-12 06:18:46 +12:00
Reilly Wood
b2c52b51b7
Change string contains operators to regex (#5117) 2022-04-07 18:23:14 +12:00
JT
cc1b784e3d
Add initial nu-test-support port (#913)
* Add initial nu-test-support port

* finish changing binary name

* Oops, these aren't Windows-safe tests
2022-02-02 15:59:01 -05:00
JT
4c9df9c7c1
Add a fallback if Windows external spawn fails (#902)
* Add a fallback if Windows external spawn fails

* Remove path workaround

* More fixes

* More fixes

* Be more flexible with error tests
2022-01-31 12:42:12 -05:00
JT
af52def93c
Fix doc comments for custom commands (#815) 2022-01-22 13:24:47 -05:00
JT
b58aad5eb0
Make external app error uniform (#812) 2022-01-23 01:12:34 +11:00
JT
bc1e1aa944
Clippy fixes for Rust 1.58 (#733)
* Clippy fixes for Rust 1.58

* Try different message
2022-01-14 06:40:25 +11:00
JT
41dbc641cc
Some cleanups for cd/PWD (#667)
* Some cleanups for cd/PWD

* Some cleanups for cd/PWD
2022-01-05 11:26:01 +11:00
JT
d603086d2f
Fix custom call scope leak, refactor tests (#580)
* Fix custom call scope leak, refactor tests

* Actually add tests
2021-12-26 06:39:42 +11:00
Michael Angerman
5d3b63fa90
add in a raw flag in the command to json (#555)
* add in the method to_string_raw

* add in a raw flag to json

* add in a test
2021-12-23 06:56:49 +11:00
Ștefan
a93a9b9029
Add skip-empty flag to lines command (#543)
* Add skip-empty flag to lines command

* Fix failing length test
2021-12-22 07:24:11 +11:00
JT
fc7ed1bfe4
switch substring to bytes (#538)
* switch substring to bytes

* Add a test
2021-12-21 11:49:02 +11:00
JT
152467a858
Flatten should flatten embedded table (#534) 2021-12-21 06:03:18 +11:00
JT
caf73c36f2
Finish adding support for optional params (#530) 2021-12-20 17:58:09 +11:00
Michael Angerman
00bb203756
add in a new command called columns (#519) 2021-12-18 12:14:28 -06:00
Ștefan
6f6340186a
Port flatten (#512)
* A first working version of flatten. Needs a lot of cleanup. Committing to have a working version

* Typo fix

* Flatten tests pass

* Final cleanup, ready for push

* Final cleanup, ready for push

* Final cleanup, ready for push

* Final cleanup, ready for push

* Update flatten.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2021-12-18 07:44:51 +11:00
Jakub Žádník
6a0f404558
Treating environment variables as Values (#497)
* Proof of concept treating env vars as Values

* Refactor env var collection and method name

* Remove unnecessary pub

* Move env translations into a new file

* Fix LS_COLORS to support any Value

* Fix spans during env var translation

* Add span to env var in cd

* Improve error diagnostics

* Fix non-string env vars failing string conversion

* Make PROMPT_COMMAND a Block instead of String

* Record host env vars to a fake file

This will give spans to env vars that would otherwise be without one.
Makes errors less confusing.

* Add 'env' command to list env vars

It will list also their values translated to strings

* Sort env command by name; Add env var type

* Remove obsolete test
2021-12-17 12:04:54 +11:00
JT
1d74d9c5ae
Fix comment issue and shadowing issue (#501) 2021-12-16 09:56:12 +11:00
Michael Angerman
1cbb785969
port over from nushell drop column (#495)
* port over from nushell drop column

* fix clippy
2021-12-15 06:54:27 +11:00
JT
04a9c8f3fd
Fix bug in chained boolean typecheck (#490) 2021-12-14 16:19:16 +11:00
Jakub Žádník
930cb26e99
Fix hiding of import patterns with globs (#487)
* Fix glob hiding

* Remove docs comment
2021-12-13 20:35:35 +02:00
Darren Schroeder
3dc19d4179
Filesize formatting (#456)
* configure the format of filesize

* type-o

* removed some comments

* updated tests

* accomodated filesize_metric better, added test
2021-12-09 13:19:36 -06:00
JT
fdde95f675
Update clippy to check all features (#441)
* Update clippy to check all features

* Fix tests

* oops
2021-12-06 07:23:43 +13:00
Michael Angerman
03e22b071a
port over the reject command from nushell (#419)
* port over reject

* add some tests to src/tests
2021-12-05 16:09:45 +13:00
JT
ccd5f59314
Update external spawn (#406)
* Simplify external spawn, improve arg cleaning

* Fix tests

* Fix windows test
2021-12-03 09:55:16 +13:00
Jakub Žádník
c17e1473db
Hiding of environment variables (#362)
* Remember environment variables from previous scope

* Re-introduce env var hiding

Right now, hiding decls is broken

* Re-introduce hidden field of import patterns

All tests pass now.

* Remove/Address tests TODOs

* Fix test typo; Report hiding error

* Add a few more tests

* Fix wrong expected test result
2021-11-30 19:14:05 +13:00
JT
143855b662
Add better comment skipping (#359) 2021-11-22 07:13:09 +13:00
Jakub Žádník
5459d30a24
Add environment variable support for modules (#331)
* Add 'expor env' dummy command

* (WIP) Abstract away module exportables as Overlay

* Switch to Overlays for use/hide

Works for decls only right now.

* Fix passing import patterns of hide to eval

* Simplify use/hide of decls

* Add ImportPattern as Expr; Add use env eval

Still no parsing of "export env" so I can't test it yet.

* Refactor export parsing; Add InternalError

* Add env var export and activation; Misc changes

Now it is possible to `use` env var that was exported from a module.

This commit also adds some new errors and other small changes.

* Add env var hiding

* Fix eval not recognizing hidden decls

Without this change, calling `hide foo`, the evaluator does not know
whether a custom command named "foo" was hidden during parsing,
therefore, it is not possible to reliably throw an error about the "foo"
name not found.

* Add use/hide/export env var tests; Cleanup; Notes

* Ignore hide env related tests for now

* Fix main branch merge mess

* Fixed multi-word export def

* Fix hiding tests on Windows

* Remove env var hiding for now
2021-11-16 12:16:06 +13:00
JT
be827e5628
Fix multiword imports/exports (#336) 2021-11-15 08:40:26 +13:00
JT
0f107b2830
Add a config variable with engine support (#332)
* Add a config variable with engine support

* Add a config variable with engine support

* Oops, cleanup
2021-11-15 08:25:57 +13:00
JT
568e566adf
Add record literal syntax (#326) 2021-11-11 12:14:00 +13:00
JT
066afb059e
Add magic in variable, part 2 (#310) 2021-11-08 20:13:55 +13:00
JT
e9a7def183
Add magic $in variable (#309)
* Add magic in variable

* Oops, missing file
2021-11-08 19:21:24 +13:00
JT
b5bade6187
Let list and table exprs get indexed (#307) 2021-11-08 12:18:00 +13:00
JT
19645575d6
Add 'did you mean' error (#305) 2021-11-08 10:48:50 +13:00
JT
00a8752c76
Move where to helper (#302) 2021-11-07 15:40:44 +13:00
JT
6c31377c21
Fix precedence parse (#298) 2021-11-06 20:31:28 +13:00
JT
d401ed64ed
Add range to the math reductions (#296) 2021-11-06 20:12:08 +13:00
JT
183d200b9f Add updating cell paths 2021-11-05 16:59:12 +13:00
JT
1949ba080e Add env shorthand 2021-11-04 15:32:35 +13:00
JT
25846d3c1e Add zip command 2021-11-02 18:28:28 +13:00
JT
d856cebebd Add a simple scope variable 2021-11-02 16:08:05 +13:00
Jakub Žádník
b340672331 Remove leftover test from previous iteration 2021-10-31 18:01:15 +02:00
Jakub Žádník
b7c0ba104f Fix hiding module; Fmt
This fixes the case when you call `hide spam`. It will now hide all
commands you'd call like `spam foo` etc.
2021-10-31 17:38:00 +02:00
Jakub Žádník
2dcfecbbd7 Add test for multi-word alias 2021-10-29 23:57:33 +03:00
Jakub Žádník
bd6c550470 Change import pattern delimiter to space
Subcommands and module imports will have the same syntax now.
2021-10-27 00:13:39 +03:00
Jakub Žádník
595fc7a7f6 Switch to cross-platform fail message 2021-10-26 21:03:12 +03:00
Jakub Žádník
402a4acd7a Fix leftover test 2021-10-26 21:03:12 +03:00
Jakub Žádník
5163dbb7a1 Add tests and cover edge cases of the :: delim. 2021-10-26 21:03:12 +03:00