@@ -191,6 +191,14 @@ ffffffffff600000-ffffffffff601000 r-xp 00000090 00:00 0 [vsysca
191
191
7f7d77d41000 7f7d77d64000 00000000 /lib/x86_64-linux-gnu/ld-2.19.so
192
192
7ffc34343000 7ffc34345000 00000000 [vdso]
193
193
ffffffffff600000 ffffffffff601000 00000090 [vsyscall]
194
+
195
+ 00400000-07000000 r-xp 00000000 00:00 0
196
+ 07000000-07093000 r-xp 06c00000 00:2e 536754 /path/to/gobench_server_main
197
+ 07093000-0722d000 rw-p 06c92000 00:2e 536754 /path/to/gobench_server_main
198
+ 0722d000-07b21000 rw-p 00000000 00:00 0
199
+ c000000000-c000036000 rw-p 00000000 00:00 0
200
+ ->
201
+ 07000000 07093000 06c00000 /path/to/gobench_server_main
194
202
`
195
203
196
204
func TestProcSelfMaps (t * testing.T ) {
@@ -200,12 +208,15 @@ func TestProcSelfMaps(t *testing.T) {
200
208
t .Fatal ("malformed test case" )
201
209
}
202
210
in , out := tt [:i ], tt [i + len ("->\n " ):]
211
+ if len (out ) > 0 && out [len (out )- 1 ] != '\n' {
212
+ out += "\n "
213
+ }
203
214
var buf bytes.Buffer
204
215
parseProcSelfMaps ([]byte (in ), func (lo , hi , offset uint64 , file , buildID string ) {
205
216
fmt .Fprintf (& buf , "%08x %08x %08x %s\n " , lo , hi , offset , file )
206
217
})
207
218
if buf .String () != out {
208
- t .Errorf ("#%d: have:\n %s\n want:\n %s" , tx , buf .String (), out )
219
+ t .Errorf ("#%d: have:\n %s\n want:\n %s\n %q \n %q " , tx , buf . String (), out , buf .String (), out )
209
220
}
210
221
}
211
222
}
0 commit comments