package terminal import ( "testing" ) func TestReadPasswordNotATTY(t *testing.T) { // When stdin is not a terminal (e.g. in CI), ReadPassword should // return an error rather than hanging or panicking. _, err := ReadPassword("Password: ") if err == nil { t.Fatal("expected error when stdin is not a terminal") } }