forked from mdgriffith/elm-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlags.elm
78 lines (70 loc) · 1.65 KB
/
Flags.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module Flags exposing (suite)
{-| -}
import Expect
import Internal.Flag as Flag
import Test
suite =
Test.describe "Flag Operations"
[ Test.test "All Flags Invalidate Themselves" <|
\_ ->
Expect.equal True (List.all (\flag -> Flag.present flag (Flag.add flag Flag.none)) allFlags)
, Test.test "All Flags don't interfere with each other" <|
\_ ->
Expect.equal True (List.all (doesntInvalidateOthers allFlags) allFlags)
]
doesntInvalidateOthers others flag =
let
withFlag =
Flag.none
|> Flag.add flag
in
List.all identity <|
List.map
(\otherFlag ->
Flag.present otherFlag (Flag.add otherFlag withFlag)
)
others
allFlags =
[ Flag.transparency
, Flag.padding
, Flag.spacing
, Flag.fontSize
, Flag.fontFamily
, Flag.width
, Flag.height
, Flag.bgColor
, Flag.bgImage
, Flag.bgGradient
, Flag.borderStyle
, Flag.fontAlignment
, Flag.fontWeight
, Flag.fontColor
, Flag.wordSpacing
, Flag.letterSpacing
, Flag.borderRound
, Flag.shadows
, Flag.overflow
, Flag.cursor
, Flag.scale
, Flag.rotate
, Flag.moveX
, Flag.moveY
, Flag.borderWidth
, Flag.borderColor
, Flag.yAlign
, Flag.xAlign
, Flag.focus
, Flag.active
, Flag.hover
, Flag.gridTemplate
, Flag.gridPosition
, Flag.heightContent
, Flag.heightFill
, Flag.widthContent
, Flag.widthFill
, Flag.alignRight
, Flag.alignBottom
, Flag.centerX
, Flag.centerY
, Flag.fontVariant
]