-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·53 lines (42 loc) · 1.27 KB
/
test.sh
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
49
50
51
52
53
#!/bin/bash
# Ensure the Rust binary exists
if [[ ! -f "./build/computor_v1" ]]; then
echo "Error: my_rust_program not found. Please compile your Rust code first."
exit 1
fi
# Run the Rust program with some example commands/arguments
echo "Running the computor_v1 program with different tests..."
# Example test 1
echo "Running test 1..."
./computor "X^2 - 5*X + 6 = 0"
echo "--------------------------"
# Example test 2
echo "Running test 2..."
./computor "X^2 - 4*X + 4 = 0"
echo "--------------------------"
# Example test 3
echo "Running test 3..."
./computor "2*X + 3 = 2*X - 5"
echo "--------------------------"
# Example test 4
echo "Running test 4..."
./computor "5 * X^0 = 5 * X^0"
echo "--------------------------"
# Example test 5
echo "Running test 5..."
./computor "2*X^3 + X^2 + 2*X + 5 = 0"
echo "--------------------------"
# Example test 6
echo "Running test 6..."
./computor "6 * X^0 + 11 * X^1 + 5 * X^2 = 1 * X^0 + 0 * X^1"
echo "--------------------------"
# Example test 7
echo "Running test 7..."
./computor "5 + 3 * X + 3 * X^2 = 1 + 0 * X^2"
echo "--------------------------"
# Example test 8
echo "Running test 8..."
./computor "5 + 3.111 * X + 3 * X^2 = 1 + 0.1 * X^2"
echo "--------------------------"
# Indicate completion
echo "All tests executed."