From 1b2b39133d81382a6ef7184d578307f270d9adc4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 2 Jul 2015 15:06:08 -0700 Subject: [PATCH] extra: regularizing some unit tests. removing a """ literal.. --- extra/svg/svg-tests.factor | 25 ++++++++++++++----------- extra/tetris/board/board-tests.factor | 2 +- extra/uu/uu-tests.factor | 10 ++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/extra/svg/svg-tests.factor b/extra/svg/svg-tests.factor index 2634f37d05..520cb7685e 100644 --- a/extra/svg/svg-tests.factor +++ b/extra/svg/svg-tests.factor @@ -1,29 +1,30 @@ ! (c)2009 Joe Groff, see BSD license -USING: accessors arrays literals math math.affine-transforms -math.functions sequences svg tools.test xml xml.traversal multiline ; +USING: accessors literals math math.affine-transforms +math.functions multiline sequences svg tools.test xml +xml.traversal ; IN: svg.tests -{ 1.0 2.25 } { -3.0 4.0 } { 5.5 0.5 } 1array [ +${ { 1.0 2.25 } { -3.0 4.0 } { 5.5 0.5 } } [ "matrix ( 1 +2.25 -3 , 0.4e+1 ,5.5, 5e-1 )" svg-transform>affine-transform ] unit-test -{ 1.0 0.0 } { 0.0 1.0 } { 5.0 10.0 } 1array [ +${ { 1.0 0.0 } { 0.0 1.0 } { 5.0 10.0 } } [ "translate(5.0, 1e1 )" svg-transform>affine-transform ] unit-test -{ 1.0 0.0 } { 0.0 1.0 } { 5.0 10.0 } 1array [ +${ { 1.0 0.0 } { 0.0 1.0 } { 5.0 10.0 } } [ "translate( 5.0 1e+1)" svg-transform>affine-transform ] unit-test -{ 2.0 0.0 } { 0.0 2.0 } { 0.0 0.0 } 1array [ +${ { 2.0 0.0 } { 0.0 2.0 } { 0.0 0.0 } } [ "scale(2.0)" svg-transform>affine-transform ] unit-test -{ 2.0 0.0 } { 0.0 4.0 } { 0.0 0.0 } 1array [ +${ { 2.0 0.0 } { 0.0 4.0 } { 0.0 0.0 } } [ "scale(2.0 4.0)" svg-transform>affine-transform ] unit-test -{ 2.0 0.0 } { 0.0 4.0 } { 0.0 0.0 } 1array [ +${ { 2.0 0.0 } { 0.0 4.0 } { 0.0 0.0 } } [ "scale(2.0 4.0)" svg-transform>affine-transform ] unit-test @@ -54,9 +55,11 @@ IN: svg.tests } 0.001 a~ ] unit-test -{ $[ 30 degrees cos ] $[ 30 degrees sin ] } -{ $[ -30 degrees sin ] $[ 30 degrees cos ] } -{ 1.0 2.0 } 1array [ +${ + { $[ 30 degrees cos ] $[ 30 degrees sin ] } + { $[ -30 degrees sin ] $[ 30 degrees cos ] } + { 1.0 2.0 } +} [ "translate(1 2) rotate(30)" svg-transform>affine-transform ] unit-test diff --git a/extra/tetris/board/board-tests.factor b/extra/tetris/board/board-tests.factor index 81ee65bcb8..816f9d7c70 100644 --- a/extra/tetris/board/board-tests.factor +++ b/extra/tetris/board/board-tests.factor @@ -5,7 +5,7 @@ USING: accessors arrays colors colors.constants kernel tetris.board tetris.piece [ 1 { f f } ] [ 2 3 { 1 1 } board@block ] unit-test [ f ] [ 2 3 { 1 1 } block ] unit-test [ 2 3 { 2 3 } block ] must-fail -COLOR: red 1array [ 2 3 dup { 1 1 } COLOR: red set-block { 1 1 } block ] unit-test +{ COLOR: red } [ 2 3 dup { 1 1 } COLOR: red set-block { 1 1 } block ] unit-test [ t ] [ 2 3 { 1 1 } block-free? ] unit-test [ f ] [ 2 3 dup { 1 1 } COLOR: red set-block { 1 1 } block-free? ] unit-test [ t ] [ 2 3 dup { 1 1 } COLOR: red set-block { 1 2 } block-free? ] unit-test diff --git a/extra/uu/uu-tests.factor b/extra/uu/uu-tests.factor index b8af167a43..4fa5d7b945 100644 --- a/extra/uu/uu-tests.factor +++ b/extra/uu/uu-tests.factor @@ -1,17 +1,15 @@ - -USING: io.streams.string kernel tools.test ; - +USING: kernel tools.test ; IN: uu CONSTANT: plain "The smooth-scaled python crept over the sleeping dog" CONSTANT: encoded -"""begin -M5&AE('-M;V]T:"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P +"begin +M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P ':6YG(&1O9P end -""" +" { t } [ plain string>uu encoded = ] unit-test { t } [ encoded uu>string plain = ] unit-test