tests/GDBMIParserTests.st
changeset 3 29ea333a1811
parent 2 a96eb336dbd3
child 4 62366cc0fd95
--- a/tests/GDBMIParserTests.st	Wed May 28 09:42:40 2014 +0100
+++ b/tests/GDBMIParserTests.st	Sat May 31 00:42:30 2014 +0100
@@ -3,8 +3,8 @@
 TestCase subclass:#GDBMIParserTests
 	instanceVariableNames:''
 	classVariableNames:''
-	poolDictionaries:''
-	category:'GDB-Private-MI-Tests'
+	poolDictionaries:'GDBMICommandStatus'
+	category:'GDB-Private-Tests'
 !
 
 !GDBMIParserTests methodsFor:'tests - C strings'!
@@ -21,3 +21,24 @@
     "Created: / 28-05-2014 / 00:05:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBMIParserTests methodsFor:'tests - examples'!
+
+test_simple_example_01
+
+    | parser events |
+
+    parser := GDBMIParser on:
+'^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048564",func="main",file="myprog.c",fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],times="0"}
+(gdb)
+'.
+    events := parser parseOutput.
+
+    self assert: events size == 1.
+    self assert: events first isCommandResultEvent.
+    self assert: events first result status == CommandStatusDone.
+    self assert: events first result value key = 'bkpt'.
+    self assert: (events first result value value propertyAt: 'addr') = '0x08048564'
+
+    "Created: / 30-05-2014 / 23:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+