-USING: alien ui.gadgets.panes ui.gadgets namespaces
-kernel sequences io io.styles io.streams.string tools.test
-prettyprint definitions help help.syntax help.markup
-help.stylesheet splitting ui.gadgets.debug models math summary
-inspector accessors help.topics see fry ;
+USING: accessors colors fonts fry help help.markup help.stylesheet
+help.syntax help.topics inspector io io.streams.string io.styles
+kernel math models namespaces prettyprint see sequences tools.test
+ui.gadgets ui.gadgets.debug ui.gadgets.panes ui.gadgets.panes.private ;
IN: ui.gadgets.panes.tests
: #children ( -- n ) "pane" get children>> length ;
{ t } [ <test-pane> dup input>> child? ] unit-test
{ t } [ <test-pane> dup last-line>> child? ] unit-test
+
+! smash-line
+{
+ ""
+ T{ font
+ { name "sans-serif" }
+ { size 12 }
+ { foreground
+ T{ rgba
+ { red 0.0 }
+ { green 0.0 }
+ { blue 0.0 }
+ { alpha 1.0 }
+ }
+ }
+ { background
+ T{ rgba
+ { red 1.0 }
+ { green 1.0 }
+ { blue 1.0 }
+ { alpha 1.0 }
+ }
+ }
+ }
+} [
+ <pane> current>> smash-line [ text>> ] [ font>> ] bi
+] unit-test
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test ui.pens.caching ;
+USING: accessors colors.constants kernel
+specialized-arrays.instances.alien.c-types.float tools.test
+ui.gadgets.labels ui.pens.caching ui.pens.gradient ;
IN: ui.pens.caching.tests
+
+! compute-pen
+{
+ { 0 0 }
+ float-array{ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 }
+ float-array{ 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 }
+} [
+ "hi" <label> { COLOR: white COLOR: black } <gradient>
+ [ compute-pen ] keep
+ [ last-dim>> ] [ last-vertices>> ] [ last-colors>> ] tri
+] unit-test