Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1288)

Delta Between Two Patch Sets: ssh/terminal/terminal_test.go

Issue 13839047: code review 13839047: go.crypto/ssh/terminal: Allow ^A and ^E as synonyms for...
Left Patch Set: Created 10 years, 6 months ago
Right Patch Set: diff -r ca17ccb492a0 https://code.google.com/p/go.crypto Created 10 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « ssh/terminal/terminal.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package terminal 5 package terminal
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 "testing" 9 "testing"
10 ) 10 )
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 line: "line1", 95 line: "line1",
96 throwAwayLines: 1, 96 throwAwayLines: 1,
97 }, 97 },
98 { 98 {
99 // recall two previous lines and append. 99 // recall two previous lines and append.
100 in: "line1\rline2\rline3\x1b[A\x1b[Axxx\r", 100 in: "line1\rline2\rline3\x1b[A\x1b[Axxx\r",
101 line: "line1xxx", 101 line: "line1xxx",
102 throwAwayLines: 2, 102 throwAwayLines: 2,
103 }, 103 },
104 { 104 {
105 in: "a b \001\013\r",
106 line: "",
107 },
108 {
109 in: "a b \001\005\013\r",
110 line: "a b ",
111 },
112 {
105 in: "\027\r", 113 in: "\027\r",
106 line: "", 114 line: "",
107 }, 115 },
108 { 116 {
109 in: "a\027\r", 117 in: "a\027\r",
110 line: "", 118 line: "",
111 }, 119 },
112 { 120 {
113 in: "a \027\r", 121 in: "a \027\r",
114 line: "", 122 line: "",
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 ss := NewTerminal(c, "> ") 196 ss := NewTerminal(c, "> ")
189 pw, _ := ss.ReadPassword("> ") 197 pw, _ := ss.ReadPassword("> ")
190 if pw != "password" { 198 if pw != "password" {
191 t.Fatalf("failed to read password, got %s", pw) 199 t.Fatalf("failed to read password, got %s", pw)
192 } 200 }
193 line, _ := ss.ReadLine() 201 line, _ := ss.ReadLine()
194 if len(line) > 0 { 202 if len(line) > 0 {
195 t.Fatalf("password was saved in history") 203 t.Fatalf("password was saved in history")
196 } 204 }
197 } 205 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b