-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Testscript for exercising adding packages | ||
|
||
# exec devbox init | ||
exec devbox install | ||
! exec rg --version | ||
! exec vim --version | ||
|
||
# First, add a --platform, and verify that the []string packages | ||
# becomes a map[string]any packages | ||
exec devbox add ripgrep --platform x86_64-darwin | ||
json.superset devbox.json expected_devbox1.json | ||
|
||
# Second, add another platform: verify that it adds to the platforms array | ||
exec devbox add ripgrep --platform x86_64-linux | ||
# Third, add an excluded-platform too | ||
exec devbox add vim --exclude-platform x86_64-linux | ||
|
||
json.superset devbox.json expected_devbox2.json | ||
|
||
-- devbox.json -- | ||
{ | ||
"packages": [ | ||
"hello", | ||
"cowsay@latest" | ||
] | ||
} | ||
|
||
-- expected_devbox1.json -- | ||
{ | ||
"packages": { | ||
"hello": "", | ||
"cowsay": "latest", | ||
"ripgrep": { | ||
"version": "latest", | ||
"platforms": ["x86_64-darwin"] | ||
} | ||
} | ||
} | ||
|
||
-- expected_devbox2.json -- | ||
{ | ||
"packages": { | ||
"hello": "", | ||
"cowsay": "latest", | ||
"ripgrep": { | ||
"version": "latest", | ||
"platforms": ["x86_64-darwin", "x86_64-linux"] | ||
}, | ||
"vim": { | ||
"version": "latest", | ||
"excluded_platforms": ["x86_64-linux"] | ||
} | ||
} | ||
} |