Skip to content

Commit

Permalink
Merge pull request #3449 from Zanadar/test/flags-test
Browse files Browse the repository at this point in the history
Add test for flags package
  • Loading branch information
whyrusleeping authored Nov 30, 2016
2 parents 5e4ca03 + 4e05f07 commit 8a1aa98
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions flags/flags_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package flags

import (
"os"
"testing"
)

// This variable is initialized before flags init(), so we export the ENV variable here.
var _lowMemOn = lowMemOn()

func lowMemOn() error {
os.Setenv("IPFS_LOW_MEM", "true")
return nil
}

func TestLowMemMode(t *testing.T) {
if !LowMemMode {
t.Fatal("LowMemMode does not turn on even with 'IPFS_LOW_MEM' ENV variable set.")
}
}

0 comments on commit 8a1aa98

Please sign in to comment.