mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 23:17:55 +02:00
fix hardcoded username in tests + another attempt at enabling bash job control + test that building docker containers works
This commit is contained in:
@ -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, "~/") {
|
||||
|
Reference in New Issue
Block a user