Skip to content

Commit

Permalink
MINOR: trim environment variable values
Browse files Browse the repository at this point in the history
When working on #78, I was hit by a test failing on linux (debian host)
Our code is triming values so we need to adjust the test code to make
sure we also trim values before doing the comparison.

Example:
```
	expected: "${debian_chroot:+($debian_chroot)}\\u@\\h:\\w\\$ "
	            	actual: "${debian_chroot:+($debian_chroot)}\\u@\\h:\\w\\$"
```
  • Loading branch information
ph committed Oct 10, 2017
1 parent 5a9ad8e commit 1b14560
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sigar_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os/user"
"path/filepath"
"runtime"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -134,7 +135,7 @@ func TestProcEnv(t *testing.T) {
assert.True(t, len(env.Vars) > 0, "env is empty")

for k, v := range env.Vars {
assert.Equal(t, os.Getenv(k), v)
assert.Equal(t, strings.TrimSpace(os.Getenv(k)), v)
}
}
}
Expand Down

0 comments on commit 1b14560

Please sign in to comment.