]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.*: more tests
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 5 Sep 2016 05:47:39 +0000 (07:47 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 5 Sep 2016 05:47:39 +0000 (07:47 +0200)
basis/ui/gadgets/panes/panes-tests.factor
basis/ui/pens/caching/caching-tests.factor

index c571e199285ee05d79ec24582ae36ac5270703be..86c65bac83353458fe21fc014cf52ddf0c667980 100644 (file)
@@ -1,8 +1,7 @@
-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 ;
@@ -125,3 +124,30 @@ ARTICLE: "test-article-2" "This is a test article"
 
 { 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
index 3a655b23aa2e69debc8a106a8e6b5e5226f53f0e..0ec5da43bc6fefca77384ac1420e2812994d63dd 100644 (file)
@@ -1,4 +1,17 @@
 ! 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