Detect a half-byte prefix and display a user-friendly error.

This commit is contained in:
Ivo Verberk
2016-01-21 20:53:05 +01:00
parent 98e3e5351b
commit de3bc00a00
8 changed files with 56 additions and 1 deletions

View File

@@ -323,6 +323,17 @@ func TestMonitor_MonitorWithPrefix(t *testing.T) {
if !strings.Contains(out, "finished with status") {
t.Fatalf("missing final status\n\n%s", out)
}
// Test identifiers of uneven length
code = mon.monitor(evalID[:7], true)
if code != 1 {
t.Fatalf("expect exit 1, got: %d", code)
}
out = ui.ErrorWriter.String()
t.Logf("dus: %s", out)
if !strings.Contains(out, "must be of even length.") {
t.Fatalf("expect even length error, got %s", out)
}
}
func TestMonitor_DumpAllocStatus(t *testing.T) {