From bff165c85c2a684f96673142c87cfd63a3dcf518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Mon, 5 Sep 2016 07:47:39 +0200 Subject: [PATCH] ui.*: more tests --- basis/ui/gadgets/panes/panes-tests.factor | 36 +++++++++++++++++++--- basis/ui/pens/caching/caching-tests.factor | 15 ++++++++- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/basis/ui/gadgets/panes/panes-tests.factor b/basis/ui/gadgets/panes/panes-tests.factor index c571e19928..86c65bac83 100644 --- a/basis/ui/gadgets/panes/panes-tests.factor +++ b/basis/ui/gadgets/panes/panes-tests.factor @@ -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 } [ dup input>> child? ] unit-test { t } [ 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 } + } + } + } +} [ + current>> smash-line [ text>> ] [ font>> ] bi +] unit-test diff --git a/basis/ui/pens/caching/caching-tests.factor b/basis/ui/pens/caching/caching-tests.factor index 3a655b23aa..0ec5da43bc 100644 --- a/basis/ui/pens/caching/caching-tests.factor +++ b/basis/ui/pens/caching/caching-tests.factor @@ -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"