forked from solana-foundation/anchor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·48 lines (42 loc) · 1.07 KB
/
test.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
echo "Building programs"
#
# Build the UncheckedAccount variant.
#
pushd programs/unchecked-account/
output=$(anchor build 2>&1 > /dev/null)
if ! [[ $output =~ "Struct field \"unchecked\" in struct \"Initialize\" is unsafe" ]]; then
echo "Error: expected /// CHECK error"
exit 1
fi
popd
#
# Build the AccountInfo variant.
#
pushd programs/account-info/
output=$(anchor build 2>&1 > /dev/null)
if ! [[ $output =~ "Struct field \"unchecked\" in struct \"Initialize\" is unsafe" ]]; then
echo "Error: expected /// CHECK error"
exit 1
fi
popd
#
# Build the duplicate-names variant.
#
pushd programs/duplicate-names/
output=$(anchor build 2>&1 > /dev/null)
if ! [[ $output =~ "Struct field \"my_account\" in struct \"FuncOne\" is unsafe" ]]; then
echo "Error: expected /// CHECK error for duplicate-names"
exit 1
fi
popd
#
# Build the control variant.
#
pushd programs/ignore-non-accounts/
if ! anchor build ; then
echo "Error: anchor build failed when it shouldn't have"
exit 1
fi
popd
echo "Success. As expected, all builds failed that were supposed to fail."