-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: The feature renaming dependency is incomplete #420
Changes from 8 commits
936f1f1
a326ac0
a8b2647
d66e761
b52baed
d7efcee
e3cc662
5fc77c3
78b09ed
9b81593
142117b
ad6f168
4906ca1
5095615
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ git = "https://github.com/kcl-lang/flask-demo-kcl-manifests", version = "v0.1.0", package = "flask-demo-kcl-manifests" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why changed here ? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package downloader | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"kcl-lang.io/kpm/pkg/utils" | ||
) | ||
|
||
const testTomlDir = "test_data_toml" | ||
|
||
func TestMarshalTOML(t *testing.T) { | ||
source := &Source{ | ||
Git: &Git{ | ||
Url: "https://github.com/kcl-lang/flask-demo-kcl-manifests", | ||
Version: "v0.1.0", | ||
}, | ||
} | ||
|
||
got_data := source.MarshalTOML("flask-demo-kcl-manifests") | ||
|
||
expected_data, _ := os.ReadFile(filepath.Join(getTestDir(testTomlDir), "expected.toml")) | ||
expected_toml := utils.RmNewline(string(expected_data)) | ||
|
||
fmt.Printf("expected_toml: '%q'\n", expected_toml) | ||
|
||
fmt.Printf("modfile: '%q'\n", got_data) | ||
assert.Equal(t, utils.RmNewline(expected_toml), utils.RmNewline(got_data)) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ func (dep *Dependencies) MarshalTOML() string { | |
const DEP_PATTERN = "%s = %s" | ||
|
||
func (dep *Dependency) MarshalTOML() string { | ||
source := dep.Source.MarshalTOML() | ||
source := dep.Source.MarshalTOML(dep.Name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not go this way, because the purpose of adding the |
||
var sb strings.Builder | ||
if len(source) != 0 { | ||
sb.WriteString(fmt.Sprintf(DEP_PATTERN, dep.Name, source)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not working and this is not due to my changes.