mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
Port setenv tests to littlecheck
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# RUN: %fish %s
|
||||
|
||||
# Verify the correct behavior of the `setenv` compatibility shim.
|
||||
|
||||
# No args to `setenv` should emit the current set of env vars. The first two
|
||||
@@ -6,15 +8,21 @@ set -g setenv1 abc
|
||||
setenv | grep '^setenv1=$'
|
||||
set -gx setenv1 xyz
|
||||
setenv | grep '^setenv1=xyz$'
|
||||
# CHECK: setenv1=xyz
|
||||
|
||||
# A single arg should set and export the named var to nothing.
|
||||
setenv setenv2
|
||||
env | grep '^setenv2=$'
|
||||
# CHECK: setenv2=
|
||||
|
||||
# Three or more args should be an error.
|
||||
echo too many arguments test >&2
|
||||
setenv var hello you
|
||||
# CHECKERR: too many arguments test
|
||||
# CHECKERR: setenv: Too many arguments
|
||||
|
||||
|
||||
# Two args should set the named var to the second arg
|
||||
setenv setenv3 'hello you'
|
||||
setenv | grep '^setenv3=hello you'
|
||||
# CHECK: setenv3=hello you
|
||||
@@ -1,2 +0,0 @@
|
||||
too many arguments test
|
||||
setenv: Too many arguments
|
||||
@@ -1,3 +0,0 @@
|
||||
setenv1=xyz
|
||||
setenv2=
|
||||
setenv3=hello you
|
||||
Reference in New Issue
Block a user