diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index d4803b7d..3b2bd3f3 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -960,7 +960,7 @@ func TestAddWithNoSumCheck(t *testing.T) { RegistryOpts: opt.RegistryOptions{ Oci: &opt.OciOptions{ Reg: "ghcr.io", - Repo: "kcl-lang", + Repo: "kcl-lang/helloworld", PkgName: "helloworld", Tag: "0.1.0", }, @@ -1102,7 +1102,7 @@ func TestAddWithDiffVersionNoSumCheck(t *testing.T) { RegistryOpts: opt.RegistryOptions{ Oci: &opt.OciOptions{ Reg: "ghcr.io", - Repo: "kcl-lang", + Repo: "kcl-lang/helloworld", PkgName: "helloworld", Tag: "0.1.2", }, @@ -1166,7 +1166,7 @@ func TestAddWithDiffVersionWithSumCheck(t *testing.T) { RegistryOpts: opt.RegistryOptions{ Oci: &opt.OciOptions{ Reg: "ghcr.io", - Repo: "kcl-lang", + Repo: "kcl-lang/helloworld", PkgName: "helloworld", Tag: "0.1.2", }, @@ -1346,7 +1346,7 @@ func TestAddWithLocalPath(t *testing.T) { RegistryOpts: opt.RegistryOptions{ Oci: &opt.OciOptions{ Reg: "ghcr.io", - Repo: "kcl-lang", + Repo: "kcl-lang/helloworld", PkgName: "helloworld", Tag: "0.1.1", }, diff --git a/pkg/cmd/cmd_add.go b/pkg/cmd/cmd_add.go index 6f481d1e..c68ca7d1 100644 --- a/pkg/cmd/cmd_add.go +++ b/pkg/cmd/cmd_add.go @@ -8,10 +8,10 @@ import ( "fmt" "os" "path/filepath" - "strings" "github.com/urfave/cli/v2" "kcl-lang.io/kpm/pkg/client" + "kcl-lang.io/kpm/pkg/constants" "kcl-lang.io/kpm/pkg/env" "kcl-lang.io/kpm/pkg/errors" "kcl-lang.io/kpm/pkg/opt" @@ -31,7 +31,7 @@ func NewAddCmd(kpmcli *client.KpmClient) *cli.Command { }, &cli.StringSliceFlag{ Name: "tag", - Usage: "Git repository tag", + Usage: "Oci or Git repository tag", }, &cli.StringSliceFlag{ Name: "commit", @@ -151,27 +151,30 @@ func parseAddOptions(c *cli.Context, kpmcli *client.KpmClient, localPath string) NoSumCheck: noSumCheck, }, nil } else { - localPkg, err := parseLocalPathOptions(c) - if err != (*reporter.KpmEvent)(nil) { - // parse from 'kpm add xxx:0.0.1'. - ociReg, err := parseOciRegistryOptions(c, kpmcli) - if err != nil { + regOpt, err := opt.NewRegistryOptionsFrom(c.Args().First(), kpmcli.GetSettings()) + + if err != nil { + return nil, err + } + + if regOpt.Oci != nil { + tag, err := onlyOnceOption(c, constants.Tag) + + if err != (*reporter.KpmEvent)(nil) { return nil, err } - return &opt.AddOptions{ - LocalPath: localPath, - NewPkgName: newPkgName, - RegistryOpts: *ociReg, - NoSumCheck: noSumCheck, - }, nil - } else { - return &opt.AddOptions{ - LocalPath: localPath, - NewPkgName: newPkgName, - RegistryOpts: *localPkg, - NoSumCheck: noSumCheck, - }, nil + + if len(tag) != 0 { + regOpt.Oci.Tag = tag + } } + + return &opt.AddOptions{ + LocalPath: localPath, + NewPkgName: newPkgName, + RegistryOpts: *regOpt, + NoSumCheck: noSumCheck, + }, nil } } @@ -215,7 +218,7 @@ func parseGitRegistryOptions(c *cli.Context) (*opt.RegistryOptions, *reporter.Kp // parseOciRegistryOptions will parse the oci registry information from user cli inputs. func parseOciRegistryOptions(c *cli.Context, kpmcli *client.KpmClient) (*opt.RegistryOptions, error) { ociPkgRef := c.Args().First() - name, version, err := ParseOciPkgNameAndVersion(ociPkgRef) + name, version, err := opt.ParseOciPkgNameAndVersion(ociPkgRef) if err != nil { return nil, err } @@ -229,40 +232,3 @@ func parseOciRegistryOptions(c *cli.Context, kpmcli *client.KpmClient) (*opt.Reg }, }, nil } - -// parseLocalPathOptions will parse the local path information from user cli inputs. -func parseLocalPathOptions(c *cli.Context) (*opt.RegistryOptions, *reporter.KpmEvent) { - localPath := c.Args().First() - if localPath == "" { - return nil, reporter.NewErrorEvent(reporter.PathIsEmpty, errors.PathIsEmpty) - } - // check if the local path exists. - if _, err := os.Stat(localPath); os.IsNotExist(err) { - return nil, reporter.NewErrorEvent(reporter.LocalPathNotExist, err) - } else { - return &opt.RegistryOptions{ - Local: &opt.LocalOptions{ - Path: localPath, - }, - }, nil - } -} - -// parseOciPkgNameAndVersion will parse package name and version -// from string ":". -func ParseOciPkgNameAndVersion(s string) (string, string, error) { - parts := strings.Split(s, ":") - if len(parts) == 1 { - return parts[0], "", nil - } - - if len(parts) > 2 { - return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s)) - } - - if parts[1] == "" { - return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s)) - } - - return parts[0], parts[1], nil -} diff --git a/pkg/cmd/cmd_update.go b/pkg/cmd/cmd_update.go index 44592061..0a6296ef 100644 --- a/pkg/cmd/cmd_update.go +++ b/pkg/cmd/cmd_update.go @@ -16,6 +16,7 @@ import ( "kcl-lang.io/kpm/pkg/client" "kcl-lang.io/kpm/pkg/env" "kcl-lang.io/kpm/pkg/mvs" + "kcl-lang.io/kpm/pkg/opt" pkg "kcl-lang.io/kpm/pkg/package" "kcl-lang.io/kpm/pkg/reporter" "kcl-lang.io/kpm/pkg/semver" @@ -134,7 +135,7 @@ func KpmUpdate(c *cli.Context, kpmcli *client.KpmClient) error { // modulesToUpgrade or modulesToDowngrade will be updated. func GetModulesToUpdate(kclPkg *pkg.KclPkg, modulesToUpgrade []module.Version, modulesToDowngrade []module.Version, pkgInfo string) error { pkgInfo = strings.TrimSpace(pkgInfo) - pkgName, pkgVersion, err := ParseOciPkgNameAndVersion(pkgInfo) + pkgName, pkgVersion, err := opt.ParseOciPkgNameAndVersion(pkgInfo) if err != nil { return err } diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index c80e1c24..7cdc4572 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -5,6 +5,10 @@ const ( TarPathSuffix = ".tar" GitPathSuffix = ".git" OciScheme = "oci" + GitScheme = "git" + HttpScheme = "http" + HttpsScheme = "https" + SshScheme = "ssh" FileEntry = "file" FileWithKclModEntry = "file_with_kcl_mod" UrlEntry = "url" @@ -12,6 +16,11 @@ const ( TarEntry = "tar" GitEntry = "git" + GitBranch = "branch" + GitCommit = "commit" + + Tag = "tag" + KCL_MOD = "kcl.mod" OCI_SEPARATOR = ":" KCL_PKG_TAR = "*.tar" diff --git a/pkg/opt/opt.go b/pkg/opt/opt.go index 8f20b3df..f974e53a 100644 --- a/pkg/opt/opt.go +++ b/pkg/opt/opt.go @@ -3,17 +3,22 @@ package opt import ( + "fmt" "io" "net/url" "os" "path/filepath" + "strings" "github.com/hashicorp/go-version" "kcl-lang.io/kcl-go/pkg/kcl" + "kcl-lang.io/kpm/pkg/constants" "kcl-lang.io/kpm/pkg/errors" "kcl-lang.io/kpm/pkg/path" "kcl-lang.io/kpm/pkg/reporter" + "kcl-lang.io/kpm/pkg/settings" "oras.land/oras-go/v2" + "oras.land/oras-go/v2/registry" ) // CompileOptions is the input options of 'kpm run'. @@ -190,6 +195,159 @@ type RegistryOptions struct { Local *LocalOptions } +// NewRegistryOptionsFrom will parse the registry options from oci url, oci ref and git url. +func NewRegistryOptionsFrom(rawUrlorOciRef string, settings *settings.Settings) (*RegistryOptions, error) { + parsedUrl, err := url.Parse(rawUrlorOciRef) + if err != nil { + return nil, err + } + + // parse the options from the local file path + localOptions, err := NewLocalOptionsFromUrl(parsedUrl) + if localOptions != nil && err == (*reporter.KpmEvent)(nil) { + return &RegistryOptions{ + Local: localOptions, + }, nil + } + + // parse the options from the git url + // https, http, git and ssh are supported + gitOptions := NewGitOptionsFromUrl(parsedUrl) + + if gitOptions != nil { + return &RegistryOptions{ + Git: gitOptions, + }, nil + } + + // parse the options from the oci url + // oci is supported + ociOptions := NewOciOptionsFromUrl(parsedUrl) + if ociOptions == nil { + ociOptions, err = NewOciOptionsFromRef(rawUrlorOciRef, settings) + if err != nil { + return nil, err + } + } + + if ociOptions != nil { + return &RegistryOptions{ + Oci: ociOptions, + }, nil + } + + return nil, fmt.Errorf("invalid dependencies source: %s", rawUrlorOciRef) +} + +// NewGitOptionsFromUrl will parse the git options from the git url. +// https, http, git and ssh are supported. +func NewGitOptionsFromUrl(parsedUrl *url.URL) *GitOptions { + if parsedUrl.Scheme != constants.GitScheme && + parsedUrl.Scheme != constants.HttpScheme && + parsedUrl.Scheme != constants.HttpsScheme && + parsedUrl.Scheme != constants.SshScheme { + return nil + } + + return &GitOptions{ + Url: parsedUrl.Host + parsedUrl.Path, + Branch: parsedUrl.Query().Get(constants.GitBranch), + Tag: parsedUrl.Query().Get(constants.Tag), + Commit: parsedUrl.Query().Get(constants.GitCommit), + } +} + +// NewOciOptionsFromUrl will parse the oci options from the oci url. +// oci is supported. +func NewOciOptionsFromUrl(parsedUrl *url.URL) *OciOptions { + if parsedUrl.Scheme != constants.OciScheme { + return nil + } + + return &OciOptions{ + Reg: parsedUrl.Host, + Repo: parsedUrl.Path, + Tag: parsedUrl.Query().Get(constants.Tag), + PkgName: filepath.Base(parsedUrl.Path), + } +} + +// NewOciOptionsFromRef will parse the oci options from the oci ref. +// The ref should be in the format of 'repoName:repoTag'. +func NewOciOptionsFromRef(refStr string, settings *settings.Settings) (*OciOptions, error) { + reg := settings.DefaultOciRegistry() + repo := settings.DefaultOciRepo() + tag := "" + + ref, err := registry.ParseReference(refStr) + if err != nil { + var pkgName string + pkgName, tag, err = ParseOciPkgNameAndVersion(refStr) + if err != nil { + return nil, err + } + if !strings.HasPrefix(pkgName, "/") { + repo = fmt.Sprintf("%s/%s", repo, pkgName) + } else { + repo = fmt.Sprintf("%s%s", repo, pkgName) + } + } else { + reg = ref.Registry + repo = ref.Repository + tag = ref.ReferenceOrDefault() + } + + return &OciOptions{ + Reg: reg, + Repo: repo, + Tag: tag, + PkgName: filepath.Base(repo), + }, nil +} + +// NewLocalOptionsFromUrl will parse the local options from the local path. +// scheme 'file' and only path is supported. +func NewLocalOptionsFromUrl(parsedUrl *url.URL) (*LocalOptions, error) { + if parsedUrl.Scheme == "" || parsedUrl.Scheme == constants.FileEntry { + return ParseLocalPathOptions(parsedUrl.Path) + } + return nil, nil +} + +// parseOciPkgNameAndVersion will parse package name and version +// from string ":". +func ParseOciPkgNameAndVersion(s string) (string, string, error) { + parts := strings.Split(s, ":") + if len(parts) == 1 { + return parts[0], "", nil + } + + if len(parts) > 2 { + return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s)) + } + + if parts[1] == "" { + return "", "", reporter.NewErrorEvent(reporter.InvalidPkgRef, fmt.Errorf("invalid oci package reference '%s'", s)) + } + + return parts[0], parts[1], nil +} + +// ParseLocalPathOptions will parse the local path information from user cli inputs. +func ParseLocalPathOptions(localPath string) (*LocalOptions, *reporter.KpmEvent) { + if localPath == "" { + return nil, reporter.NewErrorEvent(reporter.PathIsEmpty, errors.PathIsEmpty) + } + // check if the local path exists. + if _, err := os.Stat(localPath); os.IsNotExist(err) { + return nil, reporter.NewErrorEvent(reporter.LocalPathNotExist, err) + } else { + return &LocalOptions{ + Path: localPath, + }, nil + } +} + type GitOptions struct { Url string Branch string diff --git a/pkg/opt/opt_test.go b/pkg/opt/opt_test.go index 52b9e455..5dc87761 100644 --- a/pkg/opt/opt_test.go +++ b/pkg/opt/opt_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/assert" "kcl-lang.io/kcl-go/pkg/kcl" "kcl-lang.io/kpm/pkg/errors" + "kcl-lang.io/kpm/pkg/settings" ) func TestWorkDirAsPkgPath(t *testing.T) { @@ -30,3 +31,34 @@ func TestInitOptions(t *testing.T) { assert.Equal(t, o2.Validate(), nil) assert.Equal(t, o3.Validate(), errors.InvalidVersionFormat) } + +func TestNewOciOptionsFromRef(t *testing.T) { + ref := "test:latest" + settings := settings.GetSettings() + opts, err := NewRegistryOptionsFrom(ref, settings) + assert.Equal(t, err, nil) + assert.Equal(t, opts.Oci.Tag, "latest") + assert.Equal(t, opts.Oci.Repo, "kcl-lang/test") + assert.Equal(t, opts.Oci.Reg, "ghcr.io") + + opts, err = NewRegistryOptionsFrom("oci://docker.io/kcllang/test1?tag=0.0.1", settings) + assert.Equal(t, err, nil) + assert.Equal(t, opts.Oci.Tag, "0.0.1") + assert.Equal(t, opts.Oci.Repo, "/kcllang/test1") + assert.Equal(t, opts.Oci.Reg, "docker.io") + + opts, err = NewRegistryOptionsFrom("ssh://github.com/kcl-lang/test1?tag=0.0.1", settings) + assert.Equal(t, err, nil) + assert.Equal(t, opts.Git.Tag, "0.0.1") + assert.Equal(t, opts.Git.Url, "github.com/kcl-lang/test1") + + opts, err = NewRegistryOptionsFrom("http://github.com/kcl-lang/test1?commit=123456", settings) + assert.Equal(t, err, nil) + assert.Equal(t, opts.Git.Commit, "123456") + assert.Equal(t, opts.Git.Url, "github.com/kcl-lang/test1") + + opts, err = NewRegistryOptionsFrom("https://github.com/kcl-lang/test1?branch=main", settings) + assert.Equal(t, err, nil) + assert.Equal(t, opts.Git.Branch, "main") + assert.Equal(t, opts.Git.Url, "github.com/kcl-lang/test1") +} diff --git a/pkg/package/modfile.go b/pkg/package/modfile.go index 261f67d9..824182aa 100644 --- a/pkg/package/modfile.go +++ b/pkg/package/modfile.go @@ -558,10 +558,9 @@ func ParseOpt(opt *opt.RegistryOptions) (*Dependency, error) { }, nil } if opt.Oci != nil { - repoPath := utils.JoinPath(opt.Oci.Repo, opt.Oci.PkgName) ociSource := Oci{ Reg: opt.Oci.Reg, - Repo: repoPath, + Repo: opt.Oci.Repo, Tag: opt.Oci.Tag, } diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout index 0b9efb13..29c5f95e 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout @@ -1 +1 @@ -adding dependency '/path/to/not/exist' +adding dependency 'exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr index 19ce4281..e69de29b 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr @@ -1 +0,0 @@ -failed to select latest version from 'localhost:5001/test/not_exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout index b1cc3c94..e0c3ec87 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout @@ -1 +1 @@ -adding dependency '/path_not_exist' \ No newline at end of file +adding dependency 'path_not_exist' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.env b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.env new file mode 100644 index 00000000..4c789529 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.env @@ -0,0 +1,2 @@ +KPM_HOME="" +KCLVM_VENDOR_HOME="" \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.input b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.input new file mode 100644 index 00000000..54c79e08 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.input @@ -0,0 +1 @@ +kpm add oci://localhost:5001/test/helloworld \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.stderr new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.stdout new file mode 100644 index 00000000..a392ce44 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url/test_suite.stdout @@ -0,0 +1 @@ +add dependency 'helloworld' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.env b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.env new file mode 100644 index 00000000..4c789529 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.env @@ -0,0 +1,2 @@ +KPM_HOME="" +KCLVM_VENDOR_HOME="" \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.input b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.input new file mode 100644 index 00000000..2d654168 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.input @@ -0,0 +1 @@ +kpm add oci://localhost:5001/test/helloworld?tag=0.1.1 \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.stderr new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.stdout new file mode 100644 index 00000000..c2947d11 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_0/test_suite.stdout @@ -0,0 +1 @@ +add dependency 'helloworld:0.1.1' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.env b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.env new file mode 100644 index 00000000..4c789529 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.env @@ -0,0 +1,2 @@ +KPM_HOME="" +KCLVM_VENDOR_HOME="" \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.input b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.input new file mode 100644 index 00000000..c49e9360 --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.input @@ -0,0 +1 @@ +kpm add https://github.com/KusionStack/catalog.git?commit=3891e96 \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.stderr new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.stdout new file mode 100644 index 00000000..41ff69ed --- /dev/null +++ b/test/e2e/test_suites/kpm/kpm_add/test_add_with_url_1/test_suite.stdout @@ -0,0 +1 @@ +add dependency 'catalog:3891e96' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_add_with_url/kcl.mod b/test/e2e/test_suites/test_data/test_add_with_url/kcl.mod new file mode 100644 index 00000000..98ad08b6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url/kcl.mod @@ -0,0 +1,5 @@ +[package] +name = "test_add_with_url" +edition = "v0.9.0" +version = "0.0.1" + diff --git a/test/e2e/test_suites/test_data/test_add_with_url/kcl.mod.lock b/test/e2e/test_suites/test_data/test_add_with_url/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/test_data/test_add_with_url/main.k b/test/e2e/test_suites/test_data/test_add_with_url/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_add_with_url_0/kcl.mod b/test/e2e/test_suites/test_data/test_add_with_url_0/kcl.mod new file mode 100644 index 00000000..2b167892 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url_0/kcl.mod @@ -0,0 +1,4 @@ +[package] +name = "test_add_with_url" +edition = "v0.9.0" +version = "0.0.1" diff --git a/test/e2e/test_suites/test_data/test_add_with_url_0/kcl.mod.lock b/test/e2e/test_suites/test_data/test_add_with_url_0/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/test_data/test_add_with_url_0/main.k b/test/e2e/test_suites/test_data/test_add_with_url_0/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url_0/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_add_with_url_1/kcl.mod b/test/e2e/test_suites/test_data/test_add_with_url_1/kcl.mod new file mode 100644 index 00000000..98ad08b6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url_1/kcl.mod @@ -0,0 +1,5 @@ +[package] +name = "test_add_with_url" +edition = "v0.9.0" +version = "0.0.1" + diff --git a/test/e2e/test_suites/test_data/test_add_with_url_1/kcl.mod.lock b/test/e2e/test_suites/test_data/test_add_with_url_1/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/test_data/test_add_with_url_1/main.k b/test/e2e/test_suites/test_data/test_add_with_url_1/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_url_1/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file