Skip to content

Commit 1514597

Browse files
committed
add testscript unit test
1 parent c87e5d3 commit 1514597

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Testscript for exercising adding packages
2+
3+
# exec devbox init
4+
exec devbox install
5+
! exec rg --version
6+
! exec vim --version
7+
8+
# First, add a --platform, and verify that the []string packages
9+
# becomes a map[string]any packages
10+
exec devbox add ripgrep --platform x86_64-darwin
11+
json.superset devbox.json expected_devbox1.json
12+
13+
# Second, add another platform: verify that it adds to the platforms array
14+
exec devbox add ripgrep --platform x86_64-linux
15+
# Third, add an excluded-platform too
16+
exec devbox add vim --exclude-platform x86_64-linux
17+
18+
json.superset devbox.json expected_devbox2.json
19+
20+
-- devbox.json --
21+
{
22+
"packages": [
23+
"hello",
24+
"cowsay@latest"
25+
]
26+
}
27+
28+
-- expected_devbox1.json --
29+
{
30+
"packages": {
31+
"hello": "",
32+
"cowsay": "latest",
33+
"ripgrep": {
34+
"version": "latest",
35+
"platforms": ["x86_64-darwin"]
36+
}
37+
}
38+
}
39+
40+
-- expected_devbox2.json --
41+
{
42+
"packages": {
43+
"hello": "",
44+
"cowsay": "latest",
45+
"ripgrep": {
46+
"version": "latest",
47+
"platforms": ["x86_64-darwin", "x86_64-linux"]
48+
},
49+
"vim": {
50+
"version": "latest",
51+
"excluded_platforms": ["x86_64-linux"]
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)