Add test for flags.

License: MIT
Signed-off-by: Zander Mackie <zmackie@gmail.com>
This commit is contained in:
Zander Mackie 2016-11-28 07:50:48 -05:00
parent 66315b8e4f
commit 4e05f07a4e

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