-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3449 from Zanadar/test/flags-test
Add test for flags package
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") | ||
} | ||
} |