Skip to content

Commit

Permalink
Add TestEnvDiffEmptyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
pwaller committed Apr 26, 2014
1 parent 869a434 commit 6f626e0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions env_diff_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"reflect"
"testing"
)

Expand All @@ -23,6 +24,19 @@ func TestEnvDiff(t *testing.T) {
}
}

// Issue #114
// Check that empty environment variables correctly appear in the diff
func TestEnvDiffEmptyValue(t *testing.T) {
before := Env{}
after := Env{"FOO": ""}

diff := BuildEnvDiff(before, after)

if !reflect.DeepEqual(diff.Next, map[string]string(after)) {
t.Errorf("diff.Next != after (%#+v != %#+v)", diff.Next, after)
}
}

func TestIgnoredEnv(t *testing.T) {
if !IgnoredEnv(DIRENV_BASH) {
t.Fail()
Expand Down

0 comments on commit 6f626e0

Please sign in to comment.