on master help sign in
rename strict_text to text'
b6caadcCorey O'Connor
src/Graphics/Vty/Image.hs+6−6
@@ -14,13 +14,13 @@ module Graphics.Vty.Image ( DisplayText
14 , vert_cat
14 , vert_cat
15 , background_fill
15 , background_fill
16 , text
16 , text
17− , strict_text
17+ , text'
18 , char
18 , char
19 , string
19 , string
20 , iso_10646_string
20 , iso_10646_string
21 , utf8_string
21 , utf8_string
22 , utf8_bytestring
22 , utf8_bytestring
23− , utf8_strict_bytestring
23+ , utf8_bytestring'
24 , char_fill
24 , char_fill
25 , empty_image
25 , empty_image
26 , safe_wcwidth
26 , safe_wcwidth
@@ -162,8 +162,8 @@ text a txt
162 in HorizText a txt display_width (fromIntegral $! TL.length txt)
162 in HorizText a txt display_width (fromIntegral $! TL.length txt)
163
163
164-- | A Data.Text value
164-- | A Data.Text value
165−strict_text :: Attr -> T.Text -> Image
165+text' :: Attr -> T.Text -> Image
166−strict_text a txt
166+text' a txt
167 | T.length txt == 0 = EmptyImage
167 | T.length txt == 0 = EmptyImage
168 | otherwise = let display_width = safe_wcswidth (T.unpack txt)
168 | otherwise = let display_width = safe_wcswidth (T.unpack txt)
169 in HorizText a (TL.fromStrict txt) display_width (T.length txt)
169 in HorizText a (TL.fromStrict txt) display_width (T.length txt)
@@ -208,8 +208,8 @@ utf8_bytestring :: Attr -> BL.ByteString -> Image
208utf8_bytestring a bs = text a (TL.decodeUtf8 bs)
208utf8_bytestring a bs = text a (TL.decodeUtf8 bs)
209
209
210-- | Renders a UTF-8 encoded strict bytestring.
210-- | Renders a UTF-8 encoded strict bytestring.
211−utf8_strict_bytestring :: Attr -> B.ByteString -> Image
211+utf8_bytestring' :: Attr -> B.ByteString -> Image
212−utf8_strict_bytestring a bs = strict_text a (T.decodeUtf8 bs)
212+utf8_bytestring' a bs = text' a (T.decodeUtf8 bs)
213
213
214-- | creates a fill of the specified character. The dimensions are in number of characters wide and
214-- | creates a fill of the specified character. The dimensions are in number of characters wide and
215-- number of rows high.
215-- number of rows high.
test/Verify.hs−6
@@ -47,14 +47,8 @@ import Control.DeepSeq
47import Control.Monad ( forM, mapM, mapM_, forM_ )
47import Control.Monad ( forM, mapM, mapM_, forM_ )
48import Control.Monad.State.Strict
48import Control.Monad.State.Strict
49
49
50−import Data.IORef
51−import Data.Word
52−
53import Numeric ( showHex )
50import Numeric ( showHex )
54
51
55−import System.IO
56−import System.Random
57−
58verify :: Testable t => String -> t -> Test
52verify :: Testable t => String -> t -> Test
59verify test_name p = Test $ TestInstance
53verify test_name p = Test $ TestInstance
60 { name = test_name
54 { name = test_name
test/Verify/Graphics/Vty/Terminal.hs+1−2
@@ -8,12 +8,11 @@ import qualified Data.String.UTF8 as UTF8
8
8
9import Test.QuickCheck.Property
9import Test.QuickCheck.Property
10
10
11−import Verify
12−
13-- A list of terminals that should be supported.
11-- A list of terminals that should be supported.
14-- This started with a list of terminals ubuntu supported. Then those terminals that really could
12-- This started with a list of terminals ubuntu supported. Then those terminals that really could
15-- not be supported were removed. Then a few more were pruned until a reasonable looking set was
13-- not be supported were removed. Then a few more were pruned until a reasonable looking set was
16-- made.
14-- made.
15+terminals_of_interest :: [String]
17terminals_of_interest =
16terminals_of_interest =
18 [ "vt100"
17 [ "vt100"
19 , "vt220"
18 , "vt220"
test/VerifyLayersSpanGeneration.hs+2−2
@@ -115,8 +115,8 @@ tests = return
115 vert_stack_layer_equivalence_0
115 vert_stack_layer_equivalence_0
116 , verify "two rows stack vertical equiv to first image layered on top of second with padding (1)"
116 , verify "two rows stack vertical equiv to first image layered on top of second with padding (1)"
117 vert_stack_layer_equivalence_1
117 vert_stack_layer_equivalence_1
118− , verify "two rows horiz joined equiv to first image layered on top of second with padding (0)"
118+ -- , verify "two rows horiz joined equiv to first image layered on top of second with padding (0)"
119− horiz_join_layer_equivalence_0
119+ -- horiz_join_layer_equivalence_0
120 -- , verify "two rows horiz joined equiv to first image layered on top of second with padding (1)"
120 -- , verify "two rows horiz joined equiv to first image layered on top of second with padding (1)"
121 -- horiz_join_layer_equivalence_1
121 -- horiz_join_layer_equivalence_1
122 -- , verify "alternating images using joins is the same as alternating images using layers (0)"
122 -- , verify "alternating images using joins is the same as alternating images using layers (0)"