Jump to content

Template:Bar percent/testcases

From Wikipedia, the free encyclopedia

Test1

[edit]
{{Bar box|bars=
{{bar percent|foo|red|30}}
{{bar percent|bar|green|40}}
{{bar percent|baz|blue|20}}
{{bar percent|bla|orange|8}}
{{bar percent|bla|teal|2|1/50}}
}}
foo
30%
bar
40%
baz
20%
bla
8%
bla
1/50
|- |colspan=2 class=bb-min8|foo||class=bb-b|
||colspan=2 class=bb-r|30%

|-

|colspan=2 class=bb-min8|bar||class=bb-b|
||colspan=2 class=bb-r|40%

|-

|colspan=2 class=bb-min8|baz||class=bb-b|
||colspan=2 class=bb-r|20%

|-

|colspan=2 class=bb-min8|bla||class=bb-b|
||colspan=2 class=bb-r|8%

|-

|colspan=2 class=bb-min8|bla||class=bb-b|
||colspan=2 class=bb-r|1/50

Test2

[edit]
{{Bar box|bars=
{{bar percent|foo|red|30|bg=LightGray|barwidth=500px}}
{{bar percent||green|40|barwidth=500px}}
{{bar percent|bg=LightGray|barwidth=500px|baz|blue}}
{{bar percent|baz|blue|bg=LightGray|barwidth=500px}}
{{bar percent|baz|blue||bg=LightGray|barwidth=500px}}
{{bar percent|barwidth=500px|1=bla|3=8}}
{{bar percent|bla||8|barwidth=500px}}
{{bar percent|blah|teal|2|1/50|bg=LightGray|barwidth=500px}}
{{bar percent|bar|indigo|40|barwidth=500px|note=This is a note}}
{{bar percent|barbar|violet|40|bg=LightGray|barwidth=500px|note=So is this}}
}}
foo
30%
40%
baz
0%
baz
0%
baz
%
bla
8%
bla
8%
blah
1/50
bar
40% This is a note
barbar
40% So is this
|-style="background:LightGray" |colspan=2 class=bb-min8|foo||class=bb-b|
||colspan=2 class=bb-r|30%

|-

|colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%

|-style="background:LightGray"

|colspan=2 class=bb-min8|baz||class=bb-b|
||colspan=2 class=bb-r|0%

|-style="background:LightGray"

|colspan=2 class=bb-min8|baz||class=bb-b|
||colspan=2 class=bb-r|0%

|-style="background:LightGray"

|colspan=2 class=bb-min8|baz||class=bb-b|
||colspan=2 class=bb-r|0%

|-

|colspan=2 class=bb-min8|bla||class=bb-b|
||colspan=2 class=bb-r|8%

|-

|colspan=2 class=bb-min8|bla||class=bb-b|
||colspan=2 class=bb-r|8%

|-style="background:LightGray"

|colspan=2 class=bb-min8|blah||class=bb-b|
||colspan=2 class=bb-r|1/50

|-

|colspan=2 class=bb-min8|bar||class=bb-b|
||40%||class=bb-r|This is a note

|-style="background:LightGray"

|colspan=2 class=bb-min8|barbar||class=bb-b|
||40%||class=bb-r|So is this

Test3

[edit]
{{Bar box|bars=
{{bar percent||violet|40}}
}}
{{Bar box|bars=
{{bar percent||violet|40|barwidth=}}
}}
{{Bar box|bars=
{{bar percent||violet|40|barwidth=500}}
}}
{{Bar box|bars=
{{bar percent||violet|40|barwidth=500px}}
}}
{{Bar box|bars=
{{bar percent||violet|40|barwidth=Invalid}}
}}
40%
40%
40%
40%
40%
|- |colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%
|- |colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%
|- |colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%
|- |colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%
|- |colspan=2 class=bb-min8| ||class=bb-b|
||colspan=2 class=bb-r|40%