-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-api.sh
More file actions
executable file
·46 lines (37 loc) · 1.29 KB
/
test-api.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.29 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
#!/bin/bash
# Test examples for Local Rules Engine
echo "🧪 Testing Local Rules Engine API - Port 3001"
echo "============================================="
echo ""
echo "1️⃣ Testing valid email:"
curl -X POST http://localhost:3001/evaluate \
-H "Content-Type: application/json" \
-d '{"input": "John Silva has email john@email.com"}' \
-w "\n\n"
echo "2️⃣ Testing ALL CAPS text:"
curl -X POST http://localhost:3001/evaluate \
-H "Content-Type: application/json" \
-d '{"input": "THIS TEXT IS ALL IN CAPS"}' \
-w "\n\n"
echo "3️⃣ Testing invalid date:"
curl -X POST http://localhost:3001/evaluate \
-H "Content-Type: application/json" \
-d '{"input": "Birth date: 31/02/2023"}' \
-w "\n\n"
echo "4️⃣ Testing number above limit:"
curl -X POST http://localhost:3001/evaluate \
-H "Content-Type: application/json" \
-d '{"input": "Value: 1500 (above limit)"}' \
-w "\n\n"
echo "5️⃣ Testing code detection:"
curl -X POST http://localhost:3001/evaluate \
-H "Content-Type: application/json" \
-d '{"input": "console.log(\"Hello World\");"}' \
-w "\n\n"
echo "6️⃣ Testing health endpoint:"
curl -X GET http://localhost:3001/health \
-w "\n\n"
echo "7️⃣ Testing info endpoint:"
curl -X GET http://localhost:3001/ \
-w "\n\n"
echo "✅ All tests completed!"