diff --git a/interp/interp_test.go b/interp/interp_test.go
index <HASH>..<HASH> 100644
--- a/interp/interp_test.go
+++ b/interp/interp_test.go
@@ -893,6 +893,9 @@ var fileCases = []struct {
 		"char\n",
 	},
 	{"[[ -t 1234 ]]", "exit status 1"}, // TODO: reliable way to test a positive?
+	{"[[ -o wrong ]]", "exit status 1"},
+	{"[[ -o errexit ]]", "exit status 1"},
+	{"set -e; [[ -o errexit ]]", ""},
 
 	// classic test
 	{
diff --git a/interp/test.go b/interp/test.go
index <HASH>..<HASH> 100644
--- a/interp/test.go
+++ b/interp/test.go
@@ -161,7 +161,13 @@ func (r *Runner) unTest(op syntax.UnTestOperator, x string) bool {
 		return x == ""
 	case syntax.TsNempStr:
 		return x != ""
-	//case syntax.TsOptSet:
+	case syntax.TsOptSet:
+		switch x {
+		case "errexit":
+			return r.stopOnCmdErr
+		default:
+			return false
+		}
 	case syntax.TsVarSet:
 		_, e := r.lookupVar(x)
 		return e
interp: implement test's -o

For the options we currently support, at least.