ef4eecefae
* fix version * split indentation rexgexs Split the regexs as a preparation for improvement and enhancement. No explicit enhancement was intended, although the `plantuml-indent-regexp-block-start' covers more blocks now. * enhance and test regexs for groups Changed `plantuml-indent-regexp-group-start' to cover all cases mentioned on sequence diagram page of the plantuml website. Added tests for all elements-with and without label (text following the keyword). * add support and test for box/end box blocks * indentation test for a nested interface block * correction of () at end of file * indentation test for deployment diagram * file “Cask”: added dependency to dash * indentation tests for diagram commons * add indentation tests for component diagrams * regex corrections and added indentation tests for class diagrams correct indentation regexs found by tests for class diagrams * add indentation tests for object diagrams * add indentation tests for state diagrams * enhance indentation class diagram test: abstract class and interface * move indentation tests to diagram test files * mv test/plantuml-indentation-test.el -> test/plantuml-indentation-basics-test.el * add indentation sequence diagram tests and mv basics tests to diagram tests * add indentation for ref-groups * improved indentation for ref-groups * support indentation for activity diagrams - current/old style * indentation support for notes * rm not used regexs * indentation support for plantuml macros * correction: … → etc.
119 lines
2.8 KiB
EmacsLisp
119 lines
2.8 KiB
EmacsLisp
;;; plantuml-indentation-state-test.el --- PlantUML Mode indentation tests -*- lexical-binding: t; -*-
|
|
|
|
;; Author: René Schmelzer
|
|
;; Maintainer: Carlo Sciolla (skuro)
|
|
;; URL: https://github.com/skuro/plantuml-mode
|
|
|
|
;;; Commentary:
|
|
|
|
;; Test indentation for state diagrams.
|
|
|
|
;;; Code:
|
|
|
|
(ert-deftest plantuml-test-indentation/state-diagram ()
|
|
"Test correct indentation of plantuml state diagram elements.
|
|
These code examples are taken from www.plantuml.com"
|
|
(plantuml-test-indent-block
|
|
|
|
"
|
|
state NotShooting {
|
|
[*] --> Idle
|
|
Idle --> Configuring : EvConfig
|
|
Configuring --> Idle : EvConfig
|
|
}
|
|
|
|
state Configuring {
|
|
[*] --> NewValueSelection
|
|
NewValueSelection --> NewValuePreview : EvNewValue
|
|
NewValuePreview --> NewValueSelection : EvNewValueRejected
|
|
NewValuePreview --> NewValueSelection : EvNewValueSaved
|
|
|
|
state NewValuePreview {
|
|
State1 -> State2
|
|
}
|
|
|
|
}
|
|
|
|
state State3 {
|
|
state \"Accumulate Enough Data\\nLong State Name\" as long1
|
|
long1 : Just a test
|
|
[*] --> long1
|
|
long1 --> long1 : New Data
|
|
long1 --> ProcessData : Enough Data
|
|
}
|
|
|
|
state Active {
|
|
[*] -> NumLockOff
|
|
NumLockOff --> NumLockOn : EvNumLockPressed
|
|
NumLockOn --> NumLockOff : EvNumLockPressed
|
|
--
|
|
[*] -> CapsLockOff
|
|
CapsLockOff --> CapsLockOn : EvCapsLockPressed
|
|
CapsLockOn --> CapsLockOff : EvCapsLockPressed
|
|
--
|
|
[*] -> ScrollLockOff
|
|
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
|
|
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
|
|
}
|
|
|
|
state \"Not Shooting State\" as NotShooting {
|
|
state \"Idle mode\" as Idle
|
|
state \"Configuring mode\" as Configuring
|
|
[*] --> Idle
|
|
Idle --> Configuring : EvConfig
|
|
Configuring --> Idle : EvConfig
|
|
}
|
|
"
|
|
"
|
|
state NotShooting {
|
|
[*] --> Idle
|
|
Idle --> Configuring : EvConfig
|
|
Configuring --> Idle : EvConfig
|
|
}
|
|
|
|
state Configuring {
|
|
[*] --> NewValueSelection
|
|
NewValueSelection --> NewValuePreview : EvNewValue
|
|
NewValuePreview --> NewValueSelection : EvNewValueRejected
|
|
NewValuePreview --> NewValueSelection : EvNewValueSaved
|
|
|
|
state NewValuePreview {
|
|
State1 -> State2
|
|
}
|
|
|
|
}
|
|
|
|
state State3 {
|
|
state \"Accumulate Enough Data\\nLong State Name\" as long1
|
|
long1 : Just a test
|
|
[*] --> long1
|
|
long1 --> long1 : New Data
|
|
long1 --> ProcessData : Enough Data
|
|
}
|
|
|
|
state Active {
|
|
[*] -> NumLockOff
|
|
NumLockOff --> NumLockOn : EvNumLockPressed
|
|
NumLockOn --> NumLockOff : EvNumLockPressed
|
|
--
|
|
[*] -> CapsLockOff
|
|
CapsLockOff --> CapsLockOn : EvCapsLockPressed
|
|
CapsLockOn --> CapsLockOff : EvCapsLockPressed
|
|
--
|
|
[*] -> ScrollLockOff
|
|
ScrollLockOff --> ScrollLockOn : EvCapsLockPressed
|
|
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
|
|
}
|
|
|
|
state \"Not Shooting State\" as NotShooting {
|
|
state \"Idle mode\" as Idle
|
|
state \"Configuring mode\" as Configuring
|
|
[*] --> Idle
|
|
Idle --> Configuring : EvConfig
|
|
Configuring --> Idle : EvConfig
|
|
}
|
|
"))
|
|
|
|
(provide 'plantuml-indentation-state-test)
|
|
|
|
;;; plantuml-indentation-state-test.el ends here
|