@@ -23,52 +23,52 @@ def example_simple_functions():
2323 ok = True
2424
2525 # Simple script execution
26- print ("\n 📝 Simple arithmetic:" )
26+ print ("\n [*] Simple arithmetic:" )
2727 script = "2 + 2"
2828 result = dataweave .run_script (script )
2929 ok = assert_result (script , result , "4" ) and ok
3030
31- print ("\n 📝 Square root:" )
31+ print ("\n [*] Square root:" )
3232 script = "sqrt(144)"
3333 result = dataweave .run_script (script )
3434 ok = assert_result (script , result , "12" ) and ok
3535
36- print ("\n 📝 Array operations:" )
36+ print ("\n [*] Array operations:" )
3737 script = "[1, 2, 3] map $ * 2"
3838 result = dataweave .run_script (script )
3939 ok = assert_result (script , result , "[\n 2, \n 4, \n 6\n ]" ) and ok
4040
41- print ("\n 📝 String operations:" )
41+ print ("\n [*] String operations:" )
4242 script = "upper('hello world')"
4343 result = dataweave .run_script (script )
4444 ok = assert_result (script , result , '"HELLO WORLD"' ) and ok
4545
4646 # Script with inputs (simple values - auto-converted)
47- print ("\n 📝 Script with inputs (auto-converted):" )
47+ print ("\n [*] Script with inputs (auto-converted):" )
4848 script = "num1 + num2"
4949 result = dataweave .run_script (script , {"num1" : 25 , "num2" : 17 })
5050 ok = assert_result (script , result , "42" ) and ok
5151
5252 # Script with complex inputs
53- print ("\n 📝 Script with complex object:" )
53+ print ("\n [*] Script with complex object:" )
5454 script = "payload.name"
5555 result = dataweave .run_script (script , {"payload" : {"content" : '{"name": "John", "age": 30}' , "mimeType" : "application/json" }})
5656 ok = assert_result (script , result , '"John"' ) and ok
5757
5858 # Script with mixed input types
59- print ("\n 📝 Script with mixed input types:" )
59+ print ("\n [*] Script with mixed input types:" )
6060 script = "greeting ++ ' ' ++ payload.name"
6161 result = dataweave .run_script (script , {"greeting" : "Hello" , "payload" : {"content" : '{"name": "Alice", "role": "Developer"}' , "mimeType" : "application/json" }})
6262 ok = assert_result (script , result , '"Hello Alice"' ) and ok
6363
6464 # Binary output
65- print ("\n 📝 Binary output:" )
65+ print ("\n [*] Binary output:" )
6666 script = "output application/octet-stream\n ---\n dw::core::Binaries::fromBase64(\" holamund\" )"
6767 result = dataweave .run_script (script )
6868 ok = assert_result (script , result , "holamund" ) and ok
6969
7070 # Script with InputValue
71- print ("\n 📝 Inputs:" )
71+ print ("\n [*] Inputs:" )
7272 input_value = dataweave .InputValue (
7373 content = "1234567" ,
7474 mimeType = "application/csv" ,
@@ -80,7 +80,7 @@ def example_simple_functions():
8080
8181 # Cleanup when done
8282 dataweave .cleanup ()
83- print ("\n ✓ Cleanup completed" )
83+ print ("\n [OK] Cleanup completed" )
8484
8585 return ok
8686
@@ -89,9 +89,9 @@ def assert_result(script, result, expected):
8989 print (f" { script } = { result } " )
9090 ok = result .get_string () == expected
9191 if ok :
92- status = "✅ "
92+ status = "[OK] "
9393 else :
94- status = f"❌ (expected: { expected } )"
94+ status = f"[FAIL] (expected: { expected } )"
9595 print (f" result as string = { result .get_string ()} { status } " )
9696 print (f" result as bytes = { result .get_bytes ()} " )
9797 return ok
@@ -106,7 +106,7 @@ def example_context_manager():
106106 ok = True
107107
108108 with dataweave .DataWeave () as dw :
109- print ("\n 📝 Multiple operations with same runtime:" )
109+ print ("\n [*] Multiple operations with same runtime:" )
110110
111111 script = "2 + 2"
112112 result = dw .run (script )
@@ -120,7 +120,7 @@ def example_context_manager():
120120 result = dw .run (script , {"numbers" : [1 , 2 , 3 , 4 , 5 ], "multiplier" : 10 })
121121 ok = assert_result (script , result , "[\n 10, \n 20, \n 30, \n 40, \n 50\n ]" ) and ok
122122
123- print ("\n ✓ Context manager automatically cleaned up resources" )
123+ print ("\n [OK] Context manager automatically cleaned up resources" )
124124
125125 return ok
126126
@@ -131,7 +131,7 @@ def example_explicit_format():
131131 print ("Example 3: Explicit Format (Advanced)" )
132132 print ("=" * 70 )
133133
134- print ("\n 📝 Using explicit content and mimeType:" )
134+ print ("\n [*] Using explicit content and mimeType:" )
135135
136136 ok = True
137137
@@ -153,15 +153,15 @@ def example_error_handling():
153153 print ("=" * 70 )
154154
155155 try :
156- print ("\n 📝 Invalid script (will show error):" )
156+ print ("\n [*] Invalid script (will show error):" )
157157 result = dataweave .run_script ("invalid syntax here" , {})
158- print (f" Result: { result } { '✅ ' if result .success == False else '❌ ' } " )
158+ print (f" Result: { result } { '[OK] ' if result .success == False else '[FAIL] ' } " )
159159
160160 except dataweave .DataWeaveLibraryNotFoundError as e :
161- print (f"❌ Library not found: { e } " )
161+ print (f"[ERROR] Library not found: { e } " )
162162 print (" Please build the library first: ./gradlew nativeCompile" )
163163 except dataweave .DataWeaveError as e :
164- print (f"❌ DataWeave error: { e } " )
164+ print (f"[ERROR] DataWeave error: { e } " )
165165
166166
167167def main ():
@@ -181,17 +181,17 @@ def main():
181181
182182 print ("\n " + "=" * 70 )
183183 if all_ok :
184- print ("✓ All examples completed successfully!" )
184+ print ("[OK] All examples completed successfully!" )
185185 else :
186- print ("✗ One or more examples failed" )
186+ print ("[FAIL] One or more examples failed" )
187187 print ("=" * 70 )
188188
189189 except dataweave .DataWeaveLibraryNotFoundError as e :
190- print (f"\n ❌ Error: { e } " )
190+ print (f"\n [ERROR] { e } " )
191191 print ("\n Please build the native library first:" )
192192 print (" ./gradlew nativeCompile" )
193193 except Exception as e :
194- print (f"\n ❌ Unexpected error: { e } " )
194+ print (f"\n [ERROR] Unexpected error: { e } " )
195195 import traceback
196196 traceback .print_exc ()
197197
0 commit comments