jak-project/test/common/formatter/corpus/functions.test.gc

85 lines
2.1 KiB
Common Lisp

===
defun - No Docstring
===
(defun test-function ((arg0 string))
(println arg0))
---
(defun test-function ((arg0 string))
(println arg0))
===
defun - Docstring
===
(defun test-function ((arg0 string))
"hello world"
(println arg0))
---
(defun test-function ((arg0 string))
"hello world"
(println arg0))
===
Decent size and nesting
===
(defun can-display-query? ((arg0 process) (arg1 string) (arg2 float))
(let ((a1-3 (gui-control-method-12
*gui-control*
arg0
(gui-channel query)
(gui-action play)
(if arg1
arg1
(symbol->string (-> arg0 type symbol))
)
0
arg2
(new 'static 'sound-id)
)
)
)
(= (get-status *gui-control* a1-3) (gui-status active))
)
)
---
(defun can-display-query? ((arg0 process) (arg1 string) (arg2 float))
(let ((a1-3 (gui-control-method-12 *gui-control*
arg0
(gui-channel query)
(gui-action play)
(if arg1 arg1 (symbol->string (-> arg0 type symbol)))
0
arg2
(new 'static 'sound-id))))
(= (get-status *gui-control* a1-3) (gui-status active))))
===
Basic behavior
===
(defbehavior camera-teleport-to-entity process ((arg0 entity-actor))
(let ((gp-0 (new 'stack 'transformq)))
(set! (-> gp-0 trans quad) (-> arg0 extra trans quad))
(quaternion-copy! (-> gp-0 quat) (-> arg0 quat))
(vector-identity! (-> gp-0 scale))
(the-as symbol (send-event *camera* 'teleport-to-transformq gp-0))
)
)
---
(defbehavior camera-teleport-to-entity process ((arg0 entity-actor))
(let ((gp-0 (new 'stack 'transformq)))
(set! (-> gp-0 trans quad) (-> arg0 extra trans quad))
(quaternion-copy! (-> gp-0 quat) (-> arg0 quat))
(vector-identity! (-> gp-0 scale))
(the-as symbol (send-event *camera* 'teleport-to-transformq gp-0))))