@cryptotaxi247 / kubo / commits / 4e05f07a4

Add test for flags.

License: MIT Signed-off-by: Zander Mackie <zmackie@gmail.com>

Zander Mackie committed Nov 28, 2016 at 07:50 UTC 4e05f07a4ec8178062ba05076abec0265c5e0862
1 file changed +20
flags/flags_test.go new
+20
@@ -0,0 +1,20 @@
1 +package flags
2 +
3 +import (
4 + "os"
5 + "testing"
6 +)
7 +
8 +// This variable is initialized before flags init(), so we export the ENV variable here.
9 +var _lowMemOn = lowMemOn()
10 +
11 +func lowMemOn() error {
12 + os.Setenv("IPFS_LOW_MEM", "true")
13 + return nil
14 +}
15 +
16 +func TestLowMemMode(t *testing.T) {
17 + if !LowMemMode {
18 + t.Fatal("LowMemMode does not turn on even with 'IPFS_LOW_MEM' ENV variable set.")
19 + }
20 +}