]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/line-support/line-support-tests.factor
4987fdfeab4eb42e2642e38918442c3d654be677
[factor.git] / basis / ui / gadgets / line-support / line-support-tests.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays kernel tools.test ui.gadgets.editors
4 ui.gadgets.line-support ui.gadgets.line-support.private ui.text ;
5 IN: ui.gadgets.line-support.tests
6
7 ! line-gadget-height
8 { t } [
9     { 0 0 } <multiline-editor>
10     [ 1 >>min-rows line-gadget-height ]
11     [ line-height ] bi =
12 ] unit-test
13
14 ! line-gadget-width
15 { t } [
16     { 0 0 } <multiline-editor>
17     [ 1 >>min-cols line-gadget-width ]
18     [ font>> em ] bi =
19 ] unit-test
20
21 ! pref-viewport-dim*
22 { t } [
23     <multiline-editor>
24     [ 1 >>min-rows 1 >>min-cols pref-viewport-dim* ] [
25         [ font>> "m" text-width ] [ line-height ] bi 2array
26     ] bi =
27 ] unit-test