fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
c97b1a992
master
1#!/usr/bin/env python3 2from pexpect_helper import SpawnedProc 3 4sp = SpawnedProc () 5send ,sendline ,sleep ,expect_prompt ,expect_re ,expect_str = ( 6sp .send , 7sp .sendline , 8sp .sleep , 9sp .expect_prompt , 10sp .expect_re , 11sp .expect_str , 12) 13expect_prompt () 14 15# ensure the Apple key () is typeable 16sendline ("echo \xf8ff" ) 17expect_prompt ("\xf8ff" ) 18 19# check that history is returned in the right order (#2028) 20# first send 'echo stuff' 21sendline ("echo stuff" ) 22expect_prompt ("stuff" ) 23 24# last history item should be 'echo stuff' 25sendline ("echo $history[1]" ) 26expect_prompt ("echo stuff" ) 27 28# last history command should be the one that printed the history 29sendline ("echo $history[1]" ) 30expect_prompt ("echo \\$history\\[1\\]" ) 31 32# Backslashes at end of comments (#1255) 33# This backslash should NOT cause the line to continue 34sendline ("echo -n #comment\\" ) 35expect_prompt () 36 37# a pipe at the end of the line (#1285) 38sendline ("echo hoge |\n cat" ) 39expect_prompt ("hoge" ) 40 41sendline ("echo hoge | \n cat" ) 42expect_prompt ("hoge" ) 43 44sendline ("echo hoge 2>| \n cat" ) 45expect_prompt ("hoge" ) 46sendline ("echo hoge >| \n cat" ) 47expect_prompt ("hoge" ) 48 49sendline ("$fish --no-execute 2>&1" ) 50expect_prompt ("error: no-execute mode enabled and no script given. Exiting" ) 51 52sendline ("source; or echo failed" ) 53expect_prompt ("failed" ) 54 55# See that `type` tells us the function was defined interactively. 56sendline ("function foo; end; type foo" ) 57expect_str ("foo is a function with definition\r\n" ) 58expect_str ("# Defined interactively\r\n" ) 59expect_str ("function foo" ) 60expect_str ("end" ) 61expect_prompt () 62 63# See that `functions` terminates 64sendline ("functions" ) 65expect_re (".*fish_prompt," ) 66expect_prompt ()