Merge pull request #3449 from Zanadar/test/flags-test

Add test for flags package
This commit is contained in:
Jeromy Johnson 2016-11-30 14:16:01 -08:00 committed by GitHub
commit 8a1aa982e4

20
flags/flags_test.go Normal file
View File

@ -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.")
}
}