fix hardcoded username in tests + another attempt at enabling bash job control + test that building docker containers works

This commit is contained in:
David Dworken
2022-04-09 12:19:01 -07:00
parent 3619bd5447
commit e9d19eb782
3 changed files with 13 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package lib
import (
"os"
"os/user"
"path"
"strings"
"testing"
@ -39,7 +40,11 @@ func TestBuildHistoryEntry(t *testing.T) {
if entry.ExitCode != 120 {
t.Fatalf("history entry has unexpected exit code: %v", entry.ExitCode)
}
if entry.LocalUsername != "david" {
user, err := user.Current()
if err != nil {
t.Fatalf("failed to retrieve user: %v", err)
}
if entry.LocalUsername != user.Username {
t.Fatalf("history entry has unexpected user name: %v", entry.LocalUsername)
}
if !strings.HasPrefix(entry.CurrentWorkingDirectory, "/") && !strings.HasPrefix(entry.CurrentWorkingDirectory, "~/") {