Commits

shuji.w6e  committed d0fbb3a

startThis_search_senario test

  • Participants
  • Parent commits eb54923

Comments (0)

Files changed (2)

File src/main/java/SInput.java

+import java.io.PrintStream;
+
 /* SInput.java
  */
 
 /** ŒŸőˆ—î•ń“ü—Í
  */
 class SInput extends GGList {
+    
 	/** ŒŸő•ű–@ˆę——‚ĚƒŠƒXƒg
 	 */
 	String[] contentsList = {

File src/test/java/SInputCharacarizationTest.java

 import static org.hamcrest.CoreMatchers.*;
 import static org.junit.Assert.*;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.LinkedList;
 import java.util.Queue;
 
         };
         sInput.startThis();
     }
-    
+
     @Test
-    public void startThis_ŒŸőƒVƒiƒŠƒI() throws Exception {
+    public void startThis_search_senario() throws Exception {
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        final PrintStream outputPS = new PrintStream(output);
+        System.setOut(outputPS);
         final Queue<String> inputChars = new LinkedList<String>();
         inputChars.add("N");
         inputChars.add("‹ž‘ň");
             String getChars() {
                 return inputChars.poll();
             }
+
             @Override
             SOutput newSOutput() {
-                // TODO Auto-generated method stub
                 return new SOutput(getChars()) {
                     @Override
                     String getChars() {
                 };
             }
         };
+        String expected = str("", "ŒŸő•ű–@‚đŽw’č‚ľ‚Ä‚­‚ž‚ł‚˘B", "N->Ž–ź‚Š‚猟ő\tT->‹ĆŽí‚Š‚猟ő", "E->lŢŒŸőI—š(ƒƒjƒ
+                "Ž–ź‚ÉŠÜ‚Ü‚ę‚é•śŽš—ń‚đŽw’č‚ľ‚Ä‚­‚ž‚ł‚˘B", ">ŒŸőŒ‹‰Ęˆę——", "11\t‹ž‘ň@—Y“ń\tƒvƒƒOƒ‰ƒ}", "", "P->‘O‚Ě10Œ\tN->ŽŸ‚Ě10Œ",
+                "E->ŒŸőˆę——I—š( ŒŸőđŒŽw’č‚É–ß‚é )", " [lŢID,P,N,E]>", "ŒŸő•ű–@‚đŽw’č‚ľ‚Ä‚­‚ž‚ł‚˘B", "N->Ž–ź‚Š‚猟ő\tT->‹ĆŽí‚Š‚猟ő",
+                "E->lŢŒŸőI—š(ƒƒjƒ
         sInput.startThis();
-        
+        String result = new String(output.toByteArray());
+        assertThat(result, is(expected));
+    }
+
+    private String str(String... strs) {
+        StringBuilder sb = new StringBuilder();
+        String lineSeparator = System.getProperty("line.separator");
+        for (String string : strs) {
+            sb.append(string).append(lineSeparator);
+        }
+        sb.setLength(sb.length() - lineSeparator.length());
+        return sb.toString();
     }
 
     @Test
             }
         };
         sInput.functionStart(0);
-        
+
     }
-    
+
 }