aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-11-01 18:43:22 +0100
committerJakob Unterwurzacher2016-11-01 18:43:22 +0100
commit2b991c9743caa5edf38fbcdadb129ca61ffa702f (patch)
tree307059774772110a6aa63fbd35e00ac2747ab4f9 /internal/configfile/config_test.go
parent964e0e6b3634973fb9512858b4ae8707c825aaaf (diff)
Add support for unpadded base64 filenames, "-raw64"
Through base64.RawURLEncoding. New command-line parameter "-raw64".
Diffstat (limited to 'internal/configfile/config_test.go')
-rw-r--r--internal/configfile/config_test.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/configfile/config_test.go b/internal/configfile/config_test.go
index 81984fe..f993803 100644
--- a/internal/configfile/config_test.go
+++ b/internal/configfile/config_test.go
@@ -60,7 +60,7 @@ func TestLoadV2StrangeFeature(t *testing.T) {
}
func TestCreateConfFile(t *testing.T) {
- err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", false)
+ err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", false, false)
if err != nil {
t.Fatal(err)
}
@@ -68,11 +68,10 @@ func TestCreateConfFile(t *testing.T) {
if err != nil {
t.Fatal(err)
}
-
}
func TestCreateConfFileAESSIV(t *testing.T) {
- err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", true)
+ err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", true, false)
if err != nil {
t.Fatal(err)
}
@@ -85,6 +84,20 @@ func TestCreateConfFileAESSIV(t *testing.T) {
}
}
+func TestCreateConfFileRaw64(t *testing.T) {
+ err := CreateConfFile("config_test/tmp.conf", "test", false, 10, "test", false, true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, c, err := LoadConfFile("config_test/tmp.conf", "test")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !c.IsFeatureFlagSet(FlagRaw64) {
+ t.Error("FlagRaw64 flag should be set but is not")
+ }
+}
+
func TestIsFeatureFlagKnown(t *testing.T) {
// Test a few hardcoded values
testKnownFlags := []string{"DirIV", "PlaintextNames", "EMENames", "GCMIV128", "LongNames", "AESSIV"}