mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Fix eval tests.
This commit is contained in:
parent
72f92911e2
commit
9a77f61287
|
@ -33,6 +33,10 @@ var (
|
|||
ErrStillRunning = errors.New("still running")
|
||||
)
|
||||
|
||||
// Whether elvish should attempt to put itself in foreground after each pipeline
|
||||
// execution.
|
||||
var PutInForeground = true
|
||||
|
||||
type scope map[string]bool
|
||||
|
||||
type (
|
||||
|
@ -160,9 +164,11 @@ func (cp *compiler) pipeline(n *parse.Pipeline) Op {
|
|||
signal.Stop(intCh)
|
||||
|
||||
// Make sure I am in foreground.
|
||||
err := sys.Tcsetpgrp(0, syscall.Getpgrp())
|
||||
if err != nil {
|
||||
throw(err)
|
||||
if PutInForeground {
|
||||
err := sys.Tcsetpgrp(0, syscall.Getpgrp())
|
||||
if err != nil {
|
||||
throw(err)
|
||||
}
|
||||
}
|
||||
|
||||
if !allok(errors) {
|
||||
|
|
|
@ -222,6 +222,10 @@ func evalAndCollect(t *testing.T, texts []string, chsize int) ([]Value, []byte,
|
|||
return outs, outBytes, ex
|
||||
}
|
||||
|
||||
func init() {
|
||||
PutInForeground = false
|
||||
}
|
||||
|
||||
func TestEval(t *testing.T) {
|
||||
for _, tt := range evalTests {
|
||||
// fmt.Printf("eval %q\n", tt.text)
|
||||
|
|
Loading…
Reference in New Issue
Block a user