Skip to content
Snippets Groups Projects
Unverified Commit b00f428a authored by Silas Davis's avatar Silas Davis
Browse files

Fix hell tests

parent 2e4a4df2
No related branches found
No related tags found
No related merge requests found
package hell
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"strings"
"github.com/Masterminds/glide/cfg"
"github.com/stretchr/testify/assert"
)
const baseLockYml = `imports:
......@@ -52,11 +53,20 @@ testImports: []
`
func TestMergeGlideLockFiles(t *testing.T) {
lockYml, err := MergeGlideLockFiles(([]byte)(baseLockYml), ([]byte)(overrideLockYml))
baseLockFile, err := cfg.LockfileFromYaml(([]byte)(baseLockYml))
assert.NoError(t, err, "Lockfile should parse")
overrideLockFile, err := cfg.LockfileFromYaml(([]byte)(overrideLockYml))
assert.NoError(t, err, "Lockfile should parse")
mergedLockFile, err := MergeGlideLockFiles(baseLockFile, overrideLockFile)
assert.NoError(t, err, "Lockfiles should merge")
ymlLines := strings.Split(string(lockYml), "\n")
mergedYmlBytes, err := mergedLockFile.Marshal()
assert.NoError(t, err, "Lockfile should marshal")
ymlLines := strings.Split(string(mergedYmlBytes), "\n")
// Drop the updated and hash lines
actualYml := strings.Join(ymlLines[2:], "\n")
fmt.Println(actualYml)
assert.Equal(t, expectedLockYml, actualYml)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment