]> gitweb.factorcode.org Git - factor.git/blob - extra/classes/prettyprinter/prettyprinter-tests.factor
added vocab prettyprinter to classes in extra
[factor.git] / extra / classes / prettyprinter / prettyprinter-tests.factor
1 ! Copyright (C) 2023 Jean-Marc Lugrin.
2 ! See https://factorcode.org/license.txt for BSD license.
3
4 USING: tools.test classes.prettyprinter assocs io.streams.string ;
5 IN: classes.prettyprinter.tests
6
7 TUPLE: troot a b c ;
8
9 TUPLE: tchild1 < troot aa ;
10
11 TUPLE: tchild2 < troot  bb ;
12
13 { { tchild1 tchild2 } }  [ troot class-hierarchy at ] unit-test 
14
15 [ f hierarchy. ] must-fail
16
17 { "t < word\n" } [  [ t hierarchy. ] with-string-writer ] unit-test
18 { "tchild1 < troot < tuple\n" } [  [ tchild1 hierarchy. ] with-string-writer ] unit-test
19 { "troot < tuple\n| tchild1                                  IN: classes.prettyprinter.tests\n| tchild2                                  IN: classes.prettyprinter.tests\n" } 
20     [  [ troot hierarchy. ] with-string-writer ] unit-test