Separate the codebase for XL and FS format.json related code (#5317)
This commit is contained in:
committed by
kannappanr
parent
ccd9767b7a
commit
7c72d14027
@@ -17,6 +17,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
@@ -363,3 +364,19 @@ func TestContains(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test jsonLoadFromSeeker.
|
||||
func TestJSONLoadFromSeeker(t *testing.T) {
|
||||
format := newFormatFSV1()
|
||||
b, err := json.Marshal(format)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var gotFormat formatFSV1
|
||||
if err = jsonLoadFromSeeker(bytes.NewReader(b), &gotFormat); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if *format != gotFormat {
|
||||
t.Fatal("jsonLoadFromSeeker() failed to decode json")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user