dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / css / tests_style_computer_values_cases.lucb
#==============================================================================================
#
# tests_style_computer_values_cases - StyleComputer's computed values pinned to the reference
# build
#
# DESCRIPTION:
# Generated (a test vector table) from the output of a local oracle that parses each value
# with the reference build's CSS parser and runs the StyleComputer function the case
# names, or serializes it ("serialize": shorthands; ShorthandStyleValue expands them with
# StyleComputer::for_each_property_expanding_shorthands) (luce-browser-tools,
# oracles/luce-browser-engine/style_computer_values: oracle.cpp, cases.txt,
# gen_luce_cases.py).
#
#==============================================================================================
## One oracle case: the StyleComputer function, the property whose value is parsed, the value,
## the function's numeric argument and the reference build's serialization of the result.
struct TestStyleComputerValueCase:
let function: str
let property: str
let value: str
let argument: f64
let expected: str
## Every oracle case of cases.txt without "!", in order.
let test_style_computer_value_cases: TestStyleComputerValueCase[112] = [
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "ultra-condensed", argument = 0.0, expected = "50%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "extra-condensed", argument = 0.0, expected = "62.5%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "condensed", argument = 0.0, expected = "75%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "semi-condensed", argument = 0.0, expected = "87.5%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "normal", argument = 0.0, expected = "100%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "semi-expanded", argument = 0.0, expected = "112.5%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "expanded", argument = 0.0, expected = "125%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "extra-expanded", argument = 0.0, expected = "150%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "ultra-expanded", argument = 0.0, expected = "200%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "80%", argument = 0.0, expected = "80%"),
TestStyleComputerValueCase(function = "font_width", property = "font-width", value = "calc(20% + 5%)", argument = 0.0, expected = "25%"),
TestStyleComputerValueCase(function = "font_style", property = "font-style", value = "normal", argument = 0.0, expected = "normal"),
TestStyleComputerValueCase(function = "font_style", property = "font-style", value = "italic", argument = 0.0, expected = "italic"),
TestStyleComputerValueCase(function = "font_style", property = "font-style", value = "oblique", argument = 0.0, expected = "oblique"),
TestStyleComputerValueCase(function = "font_style", property = "font-style", value = "oblique 20deg", argument = 0.0, expected = "oblique 20deg"),
TestStyleComputerValueCase(function = "font_style", property = "font-style", value = "oblique -10deg", argument = 0.0, expected = "oblique -10deg"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "normal", argument = 16.0, expected = "normal"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "1.5", argument = 16.0, expected = "1.5"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "20px", argument = 16.0, expected = "20px"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "150%", argument = 16.0, expected = "24px"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "150%", argument = 13.0, expected = "19.5px"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "calc(10px + 50%)", argument = 20.0, expected = "20px"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "calc(2 * 1.5)", argument = 16.0, expected = "3"),
TestStyleComputerValueCase(function = "line_height", property = "line-height", value = "0", argument = 16.0, expected = "0"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "round", argument = 0.0, expected = "superellipse(1)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "squircle", argument = 0.0, expected = "superellipse(2)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "square", argument = 0.0, expected = "superellipse(infinity)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "bevel", argument = 0.0, expected = "superellipse(0)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "scoop", argument = 0.0, expected = "superellipse(-1)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "notch", argument = 0.0, expected = "superellipse(-infinity)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "superellipse(3)", argument = 0.0, expected = "superellipse(3)"),
TestStyleComputerValueCase(function = "corner_shape", property = "corner-top-left-shape", value = "superellipse(-2.5)", argument = 0.0, expected = "superellipse(-2.5)"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "none", argument = 0.0, expected = "none"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "center", argument = 0.0, expected = "center"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "top left", argument = 0.0, expected = "left top"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "block-start inline-start", argument = 0.0, expected = "start"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "span-all start", argument = 0.0, expected = "inline-start"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "start span-all", argument = 0.0, expected = "block-start"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "top span-all", argument = 0.0, expected = "top"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "span-all self-end", argument = 0.0, expected = "self-inline-end"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "span-block-start span-inline-end", argument = 0.0, expected = "span-start span-end"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "self-block-end self-inline-start", argument = 0.0, expected = "self-end self-start"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "span-self-block-start span-self-inline-end", argument = 0.0, expected = "span-self-start span-self-end"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "left", argument = 0.0, expected = "left"),
TestStyleComputerValueCase(function = "position_area", property = "position-area", value = "span-all", argument = 0.0, expected = "span-all"),
TestStyleComputerValueCase(function = "font_feature", property = "font-feature-settings", value = "normal", argument = 0.0, expected = "normal"),
TestStyleComputerValueCase(function = "font_feature", property = "font-feature-settings", value = "\"liga\" 0", argument = 0.0, expected = "\"liga\" 0"),
TestStyleComputerValueCase(function = "font_feature", property = "font-feature-settings", value = "\"liga\", \"kern\" 0, \"liga\" 2", argument = 0.0, expected = "\"kern\" 0, \"liga\" 2"),
TestStyleComputerValueCase(function = "font_feature", property = "font-feature-settings", value = "\"smcp\", \"c2sc\", \"aalt\" 3", argument = 0.0, expected = "\"aalt\" 3, \"c2sc\", \"smcp\""),
TestStyleComputerValueCase(function = "font_feature", property = "font-variation-settings", value = "normal", argument = 0.0, expected = "normal"),
TestStyleComputerValueCase(function = "font_feature", property = "font-variation-settings", value = "\"wght\" 400, \"wdth\" 75, \"wght\" 700", argument = 0.0, expected = "\"wdth\" 75, \"wght\" 700"),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "none", argument = 0.0, expected = "none"),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "foo", argument = 0.0, expected = "foo"),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "\"bar\"", argument = 0.0, expected = "bar"),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "\"none\"", argument = 0.0, expected = "\"none\""),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "foo, \"baz\", none", argument = 0.0, expected = "foo, baz, none"),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "\"initial\"", argument = 0.0, expected = "\"initial\""),
TestStyleComputerValueCase(function = "animation_name", property = "animation-name", value = "\"a b\"", argument = 0.0, expected = "a\\ b"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "thin", argument = 1.0, expected = "1px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "medium", argument = 1.0, expected = "3px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "thick", argument = 1.0, expected = "5px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "2.5px", argument = 1.0, expected = "2px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "2.5px", argument = 2.0, expected = "2.5px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "0.3px", argument = 1.0, expected = "1px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "0.3px", argument = 2.0, expected = "0.5px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "1.4px", argument = 1.5, expected = "1.328125px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "0px", argument = 1.0, expected = "0px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "3px", argument = 3.0, expected = "3px"),
TestStyleComputerValueCase(function = "border_width", property = "border-top-width", value = "0.5px", argument = 1.0, expected = "1px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "xx-small", argument = 0.0, expected = "9.59375px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "x-small", argument = 0.0, expected = "12px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "small", argument = 0.0, expected = "14.21875px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "medium", argument = 0.0, expected = "16px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "large", argument = 0.0, expected = "19.1875px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "x-large", argument = 0.0, expected = "24px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "xx-large", argument = 0.0, expected = "32px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "xxx-large", argument = 0.0, expected = "48px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "20px", argument = 0.0, expected = "20px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "150%", argument = 0.0, expected = "24px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "calc(50% + 2px)", argument = 0.0, expected = "10px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "math", argument = 0.0, expected = "16px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "math", argument = 1.0, expected = "11.359375px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "math", argument = 3.0, expected = "11.359375px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "math", argument = -2.0, expected = "22.53125px"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "normal", argument = 0.0, expected = "400"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "bold", argument = 0.0, expected = "700"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "bolder", argument = 0.0, expected = "700"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "lighter", argument = 0.0, expected = "100"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "350", argument = 0.0, expected = "350"),
TestStyleComputerValueCase(function = "font_weight", property = "font-weight", value = "calc(200 + 50)", argument = 0.0, expected = "250"),
TestStyleComputerValueCase(function = "math_depth", property = "math-depth", value = "auto-add", argument = 0.0, expected = "0"),
TestStyleComputerValueCase(function = "math_depth", property = "math-depth", value = "add(2)", argument = 0.0, expected = "2"),
TestStyleComputerValueCase(function = "math_depth", property = "math-depth", value = "3", argument = 0.0, expected = "3"),
TestStyleComputerValueCase(function = "math_depth", property = "math-depth", value = "calc(1 + 1)", argument = 0.0, expected = "2"),
TestStyleComputerValueCase(function = "math_depth", property = "math-depth", value = "add(-1)", argument = 0.0, expected = "-1"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "smaller", argument = 0.0, expected = "12.796875px"),
TestStyleComputerValueCase(function = "font_size", property = "font-size", value = "larger", argument = 0.0, expected = "20px"),
TestStyleComputerValueCase(function = "serialize", property = "margin", value = "1px 2px", argument = 0.0, expected = "1px 2px"),
TestStyleComputerValueCase(function = "serialize", property = "margin", value = "1px 1px 1px 1px", argument = 0.0, expected = "1px"),
TestStyleComputerValueCase(function = "serialize", property = "border", value = "1px solid red", argument = 0.0, expected = "1px solid red"),
TestStyleComputerValueCase(function = "serialize", property = "border-top", value = "thick dashed", argument = 0.0, expected = "thick dashed"),
TestStyleComputerValueCase(function = "serialize", property = "background", value = "red", argument = 0.0, expected = "red"),
TestStyleComputerValueCase(function = "serialize", property = "overflow", value = "hidden auto", argument = 0.0, expected = "hidden auto"),
TestStyleComputerValueCase(function = "serialize", property = "list-style", value = "square inside", argument = 0.0, expected = "inside square"),
TestStyleComputerValueCase(function = "serialize", property = "font", value = "italic bold 12px/30px serif", argument = 0.0, expected = "italic bold 12px / 30px serif"),
TestStyleComputerValueCase(function = "serialize", property = "place-items", value = "center start", argument = 0.0, expected = "center start"),
TestStyleComputerValueCase(function = "serialize", property = "flex", value = "1 2 10px", argument = 0.0, expected = "1 2 10px"),
TestStyleComputerValueCase(function = "serialize", property = "gap", value = "1px 2px", argument = 0.0, expected = "1px 2px"),
TestStyleComputerValueCase(function = "serialize", property = "transition", value = "opacity 1s ease-in", argument = 0.0, expected = "opacity 1s ease-in"),
TestStyleComputerValueCase(function = "serialize", property = "inset", value = "auto", argument = 0.0, expected = "auto"),
TestStyleComputerValueCase(function = "serialize", property = "text-decoration", value = "underline red", argument = 0.0, expected = "underline red"),
TestStyleComputerValueCase(function = "serialize", property = "columns", value = "3 100px", argument = 0.0, expected = "100px 3"),
]