felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1736043 - in /felix/trunk/gogo/runtime/src: main/java/org/apache/felix/gogo/runtime/Closure.java test/java/org/apache/felix/gogo/runtime/TestParser.java
Date Mon, 21 Mar 2016 16:58:19 GMT
Author: gnodet
Date: Mon Mar 21 16:58:19 2016
New Revision: 1736043

URL: http://svn.apache.org/viewvc?rev=1736043&view=rev
Log:
Add a test for isTty when capturing

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
    felix/trunk/gogo/runtime/src/test/java/org/apache/felix/gogo/runtime/TestParser.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java?rev=1736043&r1=1736042&r2=1736043&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java Mon
Mar 21 16:58:19 2016
@@ -221,6 +221,7 @@ public class Closure implements Function
             }
             if (capturingOutput != null) {
                 streams[1] = capturingOutput;
+                toclose[1] = true;
             }
 
             List<Pipe> pipes = new ArrayList<>();

Modified: felix/trunk/gogo/runtime/src/test/java/org/apache/felix/gogo/runtime/TestParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/test/java/org/apache/felix/gogo/runtime/TestParser.java?rev=1736043&r1=1736042&r2=1736043&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/test/java/org/apache/felix/gogo/runtime/TestParser.java (original)
+++ felix/trunk/gogo/runtime/src/test/java/org/apache/felix/gogo/runtime/TestParser.java Mon
Mar 21 16:58:19 2016
@@ -455,6 +455,21 @@ public class TestParser extends Abstract
         assertEquals("'abc{}'", x.get(8).toString());
     }
 
+    @Test
+    public void testIsTty() throws Exception
+    {
+        Context c = new Context();
+        c.addCommand("istty", this);
+        c.addCommand("echo", this);
+        assertEquals(true, c.execute("istty 1"));
+        assertEquals(false, c.execute("$(istty 1)"));
+    }
+
+    public boolean istty(CommandSession session, int fd)
+    {
+        return session.isTty(fd);
+    }
+
     void each(CommandSession session, Collection<Object> list, Function closure)
         throws Exception
     {



Mime
View raw message