-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_basic.sh
More file actions
executable file
·43 lines (36 loc) · 1.03 KB
/
test_basic.sh
File metadata and controls
executable file
·43 lines (36 loc) · 1.03 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
#!/bin/bash
# Basic automated test for ronto editor
echo "=== Testing Ronto Editor ==="
# Test 1: Check if binary exists
if [ ! -f "./ronto" ]; then
echo "❌ FAIL: Binary not found"
exit 1
fi
echo "✓ Binary exists"
# Test 2: Check if it shows usage without arguments
if ./ronto 2>&1 | grep -q "No Arguments"; then
echo "✓ Shows usage message"
else
echo "❌ FAIL: No usage message"
exit 1
fi
# Test 3: Create a test file
echo -e "Line 1\nLine 2\nLine 3" > test_file.txt
if [ -f "test_file.txt" ]; then
echo "✓ Created test file"
else
echo "❌ FAIL: Cannot create test file"
exit 1
fi
# Test 4: Check help option
if ./ronto -f test_file.txt 2>&1 | head -1 | grep -qE "(Error|Usage|Unrecognized)"; then
# Expected to fail in some way since we're testing non-interactively
echo "✓ Editor can be invoked (non-interactive test)"
else
echo "✓ Editor invoked"
fi
# Clean up
rm -f test_file.txt
echo ""
echo "=== Basic Tests Passed ==="
echo "Note: Full interactive testing requires manual verification"