@@ -31,8 +31,7 @@ func TestCLI(t *testing.T) {
3131
3232 for _ , tt := range tests {
3333 t .Run (strings .Join (tt .in , "_" ), func (t * testing.T ) {
34- exit , _ , out , reset := zli .Test ()
35- defer reset ()
34+ exit , _ , out := zli .Test (t )
3635 os .Args = append ([]string {"testuni" }, tt .in ... )
3736
3837 func () {
@@ -68,8 +67,7 @@ func TestIdentify(t *testing.T) {
6867
6968 for _ , tt := range tests {
7069 t .Run (strings .Join (tt .in , "_" ), func (t * testing.T ) {
71- exit , _ , out , reset := zli .Test ()
72- defer reset ()
70+ exit , _ , out := zli .Test (t )
7371 os .Args = append ([]string {"testuni" }, tt .in ... )
7472
7573 func () {
@@ -109,8 +107,7 @@ func TestSearch(t *testing.T) {
109107
110108 for _ , tt := range tests {
111109 t .Run (strings .Join (tt .in , "_" ), func (t * testing.T ) {
112- exit , _ , outbuf , reset := zli .Test ()
113- defer reset ()
110+ exit , _ , outbuf := zli .Test (t )
114111 os .Args = append ([]string {"testuni" }, tt .in ... )
115112
116113 func () {
@@ -168,8 +165,7 @@ func TestPrint(t *testing.T) {
168165
169166 for _ , tt := range tests {
170167 t .Run (strings .Join (tt .in , "_" ), func (t * testing.T ) {
171- exit , _ , outbuf , reset := zli .Test ()
172- defer reset ()
168+ exit , _ , outbuf := zli .Test (t )
173169 os .Args = append ([]string {"testuni" }, tt .in ... )
174170
175171 func () {
@@ -241,8 +237,7 @@ func TestEmoji(t *testing.T) {
241237
242238 for _ , tt := range tests {
243239 t .Run (strings .Join (tt .in , "_" ), func (t * testing.T ) {
244- _ , _ , outbuf , reset := zli .Test ()
245- defer reset ()
240+ _ , _ , outbuf := zli .Test (t )
246241 os .Args = append ([]string {"testuni" }, tt .in ... )
247242
248243 main ()
@@ -268,8 +263,7 @@ func TestEmoji(t *testing.T) {
268263}
269264
270265func TestAllEmoji (t * testing.T ) {
271- exit , _ , outbuf , reset := zli .Test ()
272- defer reset ()
266+ exit , _ , outbuf := zli .Test (t )
273267 os .Args = append ([]string {"testuni" }, []string {"e" , "-q" , "-gender" , "all" , "-tone" , "all" , "all" }... )
274268
275269 func () {
@@ -323,8 +317,7 @@ func TestAllEmoji(t *testing.T) {
323317}
324318
325319func TestJSON (t * testing.T ) {
326- _ , _ , outbuf , reset := zli .Test ()
327- defer reset ()
320+ _ , _ , outbuf := zli .Test (t )
328321
329322 os .Args = append ([]string {"testuni" }, "i" , "€" , "-f=all" , "-j" )
330323 main ()
0 commit comments