tests: use .replace_each() instead of a .replace() chain

pull/7103/head
Delyan Angelov 2020-12-02 19:47:07 +02:00
parent ce1fa1194d
commit 4b94c29c91
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 10 additions and 2 deletions

View File

@ -61,8 +61,16 @@ pub fn (mut ts TestSession) print_messages() {
return
}
ts.nmessage_idx++
msg := rmessage.message.replace('TMP1', '${ts.nmessage_idx:1d}').replace('TMP2',
'${ts.nmessage_idx:2d}').replace('TMP3', '${ts.nmessage_idx:3d}')
msg := rmessage.message.replace_each([
'TMP1',
'${ts.nmessage_idx:1d}',
'TMP2',
'${ts.nmessage_idx:2d}',
'TMP3',
'${ts.nmessage_idx:3d}',
'TMP4',
'${ts.nmessage_idx:4d}',
])
is_ok := rmessage.kind == .ok
//
time_passed := print_msg_time.elapsed().seconds()