use json_to_table::{json_to_table, Orientation};
use serde_json::json;
use tabled::assert::test_table;
use tabled::settings::Style;
test_table!(
orientation_test_1,
json_to_table(&json!({
"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.object_orientation(Orientation::Row),
"╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
"║ widget ║"
"╠══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣"
"║ ╔═══════╦═══════════════════════════════════════════════════════════════╦══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╦═══════════════════════════════════════════════════════════════════╗ ║"
"║ ║ debug ║ image ║ text ║ window ║ ║"
"║ ╠═══════╬═══════════════════════════════════════════════════════════════╬══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╬═══════════════════════════════════════════════════════════════════╣ ║"
"║ ║ on ║ ╔═══════════╦═════════╦════════╦══════════════════╦═════════╗ ║ ╔═══════════╦══════════════╦═════════╦═════════╦═════════════════════════════════════════════╦══════╦════════╦═════════╗ ║ ╔════════╦═══════════════╦══════════════════════════════╦═══════╗ ║ ║"
"║ ║ ║ ║ alignment ║ hOffset ║ name ║ src ║ vOffset ║ ║ ║ alignment ║ data ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║ ║ ║ height ║ name ║ title ║ width ║ ║ ║"
"║ ║ ║ ╠═══════════╬═════════╬════════╬══════════════════╬═════════╣ ║ ╠═══════════╬══════════════╬═════════╬═════════╬═════════════════════════════════════════════╬══════╬════════╬═════════╣ ║ ╠════════╬═══════════════╬══════════════════════════════╬═══════╣ ║ ║"
"║ ║ ║ ║ center ║ 250 ║ sun1 ║ Images/Sun.png ║ 250 ║ ║ ║ center ║ Click Here ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║ ║ ║ 500 ║ main_window ║ Sample Konfabulator Widget ║ 500 ║ ║ ║"
"║ ║ ║ ╚═══════════╩═════════╩════════╩══════════════════╩═════════╝ ║ ╚═══════════╩══════════════╩═════════╩═════════╩═════════════════════════════════════════════╩══════╩════════╩═════════╝ ║ ╚════════╩═══════════════╩══════════════════════════════╩═══════╝ ║ ║"
"║ ╚═══════╩═══════════════════════════════════════════════════════════════╩══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╩═══════════════════════════════════════════════════════════════════╝ ║"
"╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝"
);
test_table!(
orientation_test_2,
json_to_table(&json!({
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}))
.with(Style::modern())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row),
"┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"
"│ glossary │"
"├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤"
"│ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────┐ │"
"│ │ GlossDiv │ title │ │"
"│ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤ │"
"│ │ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────┐ │ example glossary │ │"
"│ │ │ GlossList │ title │ │ │ │"
"│ │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────┤ │ │ │"
"│ │ │ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ S │ │ │ │"
"│ │ │ │ GlossEntry │ │ │ │ │ │"
"│ │ │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ │ │ │ │"
"│ │ │ │ ┌─────────────────┬─────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┬────────────────────────────────────────┬────────┬────────┐ │ │ │ │ │ │"
"│ │ │ │ │ Abbrev │ Acronym │ GlossDef │ GlossSee │ GlossTerm │ ID │ SortAs │ │ │ │ │ │ │"
"│ │ │ │ ├─────────────────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼────────────────────────────────────────┼────────┼────────┤ │ │ │ │ │ │"
"│ │ │ │ │ ISO 8879:1986 │ SGML │ ┌───────────────────┬────────────────────────────────────────────────────────────────────────────┐ │ markup │ Standard Generalized Markup Language │ SGML │ SGML │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ │ GlossSeeAlso │ para │ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ ├───────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ │ ┌───────┬───────┐ │ A meta-markup language, used to create markup languages such as DocBook. │ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ │ │ GML │ XML │ │ │ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ │ └───────┴───────┘ │ │ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ │ │ │ └───────────────────┴────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ │ │ │ │ │ │"
"│ │ │ │ └─────────────────┴─────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┴────────────────────────────────────────┴────────┴────────┘ │ │ │ │ │ │"
"│ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │"
"│ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────┘ │ │ │"
"│ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┘ │"
"└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘"
);
test_table!(
orientation_visitor_test,
json_to_table(&json!({
"menu": {
"header": "SVG Viewer",
"items": [
{"id": "Open"},
{"id": "OpenNew", "label": "Open New"},
null,
{"id": "ZoomIn", "label": "Zoom In"},
{"id": "ZoomOut", "label": "Zoom Out"},
{"id": "OriginalView", "label": "Original View"},
null,
{"id": "Quality"},
{"id": "Pause"},
{"id": "Mute"},
null,
{"id": "Find", "label": "Find..."},
{"id": "FindAgain", "label": "Find Again"},
{"id": "Copy"},
{"id": "CopyAgain", "label": "Copy Again"},
{"id": "CopySVG", "label": "Copy SVG"},
{"id": "ViewSVG", "label": "View SVG"},
{"id": "ViewSource", "label": "View Source"},
{"id": "SaveAs", "label": "Save As"},
null,
{"id": "Help"},
{"id": "About", "label": "About Adobe CVG Viewer..."}
]
}
}))
.with(Style::modern()),
"┌──────┬──────────────────────────────────────────────────────────┐"
"│ menu │ ┌────────┬─────────────────────────────────────────────┐ │"
"│ │ │ header │ SVG Viewer │ │"
"│ │ ├────────┼─────────────────────────────────────────────┤ │"
"│ │ │ items │ ┌─────────────────────────────────────────┐ │ │"
"│ │ │ │ │ ┌────┬────────┐ │ │ │"
"│ │ │ │ │ │ id │ Open │ │ │ │"
"│ │ │ │ │ └────┴────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬────────────┐ │ │ │"
"│ │ │ │ │ │ id │ OpenNew │ │ │ │"
"│ │ │ │ │ ├───────┼────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Open New │ │ │ │"
"│ │ │ │ │ └───────┴────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬───────────┐ │ │ │"
"│ │ │ │ │ │ id │ ZoomIn │ │ │ │"
"│ │ │ │ │ ├───────┼───────────┤ │ │ │"
"│ │ │ │ │ │ label │ Zoom In │ │ │ │"
"│ │ │ │ │ └───────┴───────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬────────────┐ │ │ │"
"│ │ │ │ │ │ id │ ZoomOut │ │ │ │"
"│ │ │ │ │ ├───────┼────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Zoom Out │ │ │ │"
"│ │ │ │ │ └───────┴────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬─────────────────┐ │ │ │"
"│ │ │ │ │ │ id │ OriginalView │ │ │ │"
"│ │ │ │ │ ├───────┼─────────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Original View │ │ │ │"
"│ │ │ │ │ └───────┴─────────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌────┬───────────┐ │ │ │"
"│ │ │ │ │ │ id │ Quality │ │ │ │"
"│ │ │ │ │ └────┴───────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌────┬─────────┐ │ │ │"
"│ │ │ │ │ │ id │ Pause │ │ │ │"
"│ │ │ │ │ └────┴─────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌────┬────────┐ │ │ │"
"│ │ │ │ │ │ id │ Mute │ │ │ │"
"│ │ │ │ │ └────┴────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬───────────┐ │ │ │"
"│ │ │ │ │ │ id │ Find │ │ │ │"
"│ │ │ │ │ ├───────┼───────────┤ │ │ │"
"│ │ │ │ │ │ label │ Find... │ │ │ │"
"│ │ │ │ │ └───────┴───────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬──────────────┐ │ │ │"
"│ │ │ │ │ │ id │ FindAgain │ │ │ │"
"│ │ │ │ │ ├───────┼──────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Find Again │ │ │ │"
"│ │ │ │ │ └───────┴──────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌────┬────────┐ │ │ │"
"│ │ │ │ │ │ id │ Copy │ │ │ │"
"│ │ │ │ │ └────┴────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬──────────────┐ │ │ │"
"│ │ │ │ │ │ id │ CopyAgain │ │ │ │"
"│ │ │ │ │ ├───────┼──────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Copy Again │ │ │ │"
"│ │ │ │ │ └───────┴──────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬────────────┐ │ │ │"
"│ │ │ │ │ │ id │ CopySVG │ │ │ │"
"│ │ │ │ │ ├───────┼────────────┤ │ │ │"
"│ │ │ │ │ │ label │ Copy SVG │ │ │ │"
"│ │ │ │ │ └───────┴────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬────────────┐ │ │ │"
"│ │ │ │ │ │ id │ ViewSVG │ │ │ │"
"│ │ │ │ │ ├───────┼────────────┤ │ │ │"
"│ │ │ │ │ │ label │ View SVG │ │ │ │"
"│ │ │ │ │ └───────┴────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬───────────────┐ │ │ │"
"│ │ │ │ │ │ id │ ViewSource │ │ │ │"
"│ │ │ │ │ ├───────┼───────────────┤ │ │ │"
"│ │ │ │ │ │ label │ View Source │ │ │ │"
"│ │ │ │ │ └───────┴───────────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬───────────┐ │ │ │"
"│ │ │ │ │ │ id │ SaveAs │ │ │ │"
"│ │ │ │ │ ├───────┼───────────┤ │ │ │"
"│ │ │ │ │ │ label │ Save As │ │ │ │"
"│ │ │ │ │ └───────┴───────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌────┬────────┐ │ │ │"
"│ │ │ │ │ │ id │ Help │ │ │ │"
"│ │ │ │ │ └────┴────────┘ │ │ │"
"│ │ │ │ ├─────────────────────────────────────────┤ │ │"
"│ │ │ │ │ ┌───────┬─────────────────────────────┐ │ │ │"
"│ │ │ │ │ │ id │ About │ │ │ │"
"│ │ │ │ │ ├───────┼─────────────────────────────┤ │ │ │"
"│ │ │ │ │ │ label │ About Adobe CVG Viewer... │ │ │ │"
"│ │ │ │ │ └───────┴─────────────────────────────┘ │ │ │"
"│ │ │ │ └─────────────────────────────────────────┘ │ │"
"│ │ └────────┴─────────────────────────────────────────────┘ │"
"└──────┴──────────────────────────────────────────────────────────┘"
);
test_table!(
collapse_array_orientation_test_1,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔════════╦═══════╦═══════════════════════════════════════════════════════╗"
"║ widget ║ debug ║ on ║"
"║ ╠═══════╬═══════════╦═══════════════════════════════════════════╣"
"║ ║ text ║ alignment ║ center ║"
"║ ║ ╠═══════════╬═════════════════╦═══════════╦═════════════╣"
"║ ║ ║ data ║ Click Here ║ asda ║ 123132 ║"
"║ ║ ╠═══════════╬═════════════════╩═══════════╩═════════════╣"
"║ ║ ║ hOffset ║ 250 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ name ║ text1 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ onMouseUp ║ sun1.opacity = (sun1.opacity / 100) * 90; ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ size ║ 36 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ style ║ bold ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ vOffset ║ 100 ║"
"╚════════╩═══════╩═══════════╩═══════════════════════════════════════════╝"
);
test_table!(
collapse_array_orientation_test_2,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", {"123132": 11}],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔════════╦═══════╦═══════════════════════════════════════════════════════╗"
"║ widget ║ debug ║ on ║"
"║ ╠═══════╬═══════════╦═══════════════════════════════════════════╣"
"║ ║ text ║ alignment ║ center ║"
"║ ║ ╠═══════════╬═════════════════╦═══════════╦═════════════╣"
"║ ║ ║ data ║ Click Here ║ asda ║ 123132 ║"
"║ ║ ╠═══════════╬══════════╦═══╦══╩╦═══╦═════╦╩═══════╦═════╣"
"║ ║ ║ data1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║"
"║ ║ ╠═══════════╬══════════╩═══╩═══╩═══╩═════╩════════╩═════╣"
"║ ║ ║ hOffset ║ 250 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ name ║ text1 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ onMouseUp ║ sun1.opacity = (sun1.opacity / 100) * 90; ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ size ║ 36 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ style ║ bold ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ vOffset ║ 100 ║"
"╚════════╩═══════╩═══════════╩═══════════════════════════════════════════╝"
);
test_table!(
collapse_array_orientation_test_3,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", "123132", 11],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔════════╦═══════╦═══════════════════════════════════════════════════════╗"
"║ widget ║ debug ║ on ║"
"║ ╠═══════╬═══════════╦═══════════════════════════════════════════╣"
"║ ║ text ║ alignment ║ center ║"
"║ ║ ╠═══════════╬═════════════════╦═══════════╦═════════════╣"
"║ ║ ║ data ║ Click Here ║ asda ║ 123132 ║"
"║ ║ ╠═══════════╬═════════╦═══╦═══╬═══╦═════╦═╩═══════╦═════╣"
"║ ║ ║ data1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║"
"║ ║ ╠═══════════╬═════════╩═══╩═══╩═══╩═════╩═════════╩═════╣"
"║ ║ ║ hOffset ║ 250 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ name ║ text1 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ onMouseUp ║ sun1.opacity = (sun1.opacity / 100) * 90; ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ size ║ 36 ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ style ║ bold ║"
"║ ║ ╠═══════════╬═══════════════════════════════════════════╣"
"║ ║ ║ vOffset ║ 100 ║"
"╚════════╩═══════╩═══════════╩═══════════════════════════════════════════╝"
);
test_table!(
collapse_array_orientation_test_4,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132"],
"data0": "",
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔═══════╦══════════════════════╦════════════════╦══════════════════╗"
"║ data ║ Click Here ║ asda ║ 123132 ║"
"╠═══════╬══════════════════════╩════════════════╩══════════════════╣"
"║ data0 ║ ║"
"╠═══════╬═══════╦═══╦═══╦═══╦════╦════════╦════╦═══╦═══╦═══╦═══╦═══╣"
"║ data1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║"
"╠═══════╬═══════╬═══╩╦══╩═╦═╩══╦═╩═════╦══╩════╬═══╩═══╬═══╩═╦═╩═══╣"
"║ data2 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"╚═══════╩═══════╩════╩════╩════╩═══════╩═══════╩═══════╩═════╩═════╝"
);
test_table!(
collapse_array_orientation_test_5,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔═══════╦════════════════════╦════════════╦══════════════╦═════════╗"
"║ data ║ Click Here ║ asda ║ 123132 ║ 1 ║"
"╠═══════╬═══════╦═══╦═══╦═══╦╩═══╦════════╬════╦═══╦═══╦═╩═╦═══╦═══╣"
"║ data1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║"
"╠═══════╬═══════╬═══╩╦══╩═╦═╩══╦═╩═════╦══╩════╬═══╩═══╬═══╩═╦═╩═══╣"
"║ data2 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"╚═══════╩═══════╩════╩════╩════╩═══════╩═══════╩═══════╩═════╩═════╝"
);
test_table!(
collapse_array_orientation_test_6,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], {"aa": "123132", "bb": "123132"}, [11, 1, 1, 1, 1, 1]],
"data2": { "11": {"x": "xxx"}, "22": 1 },
"data3": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.array_orientation(Orientation::Row)
.collapse(),
"╔═══════╦════════════════════╦════════════╦══════════════╦═════════╗"
"║ data ║ Click Here ║ asda ║ 123132 ║ 1 ║"
"╠═══════╬═══════╦═══╦═══╦═══╦╩═══╦════════╬════╦═══╦═══╦═╩═╦═══╦═══╣"
"║ data1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║"
"║ ║ ║ ║ ║ ╠════╬════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ bb ║ 123132 ║ ║ ║ ║ ║ ║ ║"
"╠═══════╬════╦══╩╦══╩═══╩═══╩════╩════════╩════╩═══╩═══╩═══╩═══╩═══╣"
"║ data2 ║ 11 ║ x ║ xxx ║"
"║ ╠════╬═══╩═════════════════════════════════════════════════╣"
"║ ║ 22 ║ 1 ║"
"╠═══════╬════╩══╦════╦════╦════╦═══════╦═══════╦═══════╦═════╦═════╣"
"║ data3 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"╚═══════╩═══════╩════╩════╩════╩═══════╩═══════╩═══════╩═════╩═════╝"
);
test_table!(
collapse_object_orientation_test_1,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.collapse(),
"╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
"║ widget ║"
"╠═══════╦═══════════════════════════════════════════════════════════════════════════════════════════════════════════════╣"
"║ debug ║ text ║"
"╠═══════╬═══════════╦════════════╦═════════╦═══════╦═══════════════════════════════════════════╦══════╦═══════╦═════════╣"
"║ on ║ alignment ║ data ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║"
"║ ╠═══════════╬════════════╬═════════╬═══════╬═══════════════════════════════════════════╬══════╬═══════╬═════════╣"
"║ ║ center ║ Click Here ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║"
"║ ║ ╠════════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ asda ║ ║ ║ ║ ║ ║ ║"
"║ ║ ╠════════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ 123132 ║ ║ ║ ║ ║ ║ ║"
"╚═══════╩═══════════╩════════════╩═════════╩═══════╩═══════════════════════════════════════════╩══════╩═══════╩═════════╝"
);
test_table!(
collapse_object_orientation_test_2,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", {"123132": 11}],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.collapse(),
"╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
"║ widget ║"
"╠═══════╦════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣"
"║ debug ║ text ║"
"╠═══════╬═══════════╦════════════╦════════╦═════════╦═══════╦═══════════════════════════════════════════╦══════╦═══════╦═════════╣"
"║ on ║ alignment ║ data ║ data1 ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║"
"║ ╠═══════════╬════════════╬════════╬═════════╬═══════╬═══════════════════════════════════════════╬══════╬═══════╬═════════╣"
"║ ║ center ║ Click Here ║ Click ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║"
"║ ║ ║ ╠════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ 1 ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ╠════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ 3 ║ ║ ║ ║ ║ ║ ║"
"║ ║ ╠════════════╬════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ asda ║ 4 ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ╠════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ aa ║ ║ ║ ║ ║ ║ ║"
"║ ║ ╠════════════╬════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ 123132 ║ 123132 ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ╠════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ 11 ║ ║ ║ ║ ║ ║ ║"
"╚═══════╩═══════════╩════════════╩════════╩═════════╩═══════╩═══════════════════════════════════════════╩══════╩═══════╩═════════╝"
);
test_table!(
collapse_object_orientation_test_3,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", "123132", 11],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::modern())
.object_orientation(Orientation::Row)
.collapse(),
"┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"
"│ widget │"
"├───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤"
"│ debug │ text │"
"├───────┼───────────┬────────────┬────────┬─────────┬───────┬───────────────────────────────────────────┬──────┬───────┬─────────┤"
"│ on │ alignment │ data │ data1 │ hOffset │ name │ onMouseUp │ size │ style │ vOffset │"
"│ ├───────────┼────────────┼────────┼─────────┼───────┼───────────────────────────────────────────┼──────┼───────┼─────────┤"
"│ │ center │ Click Here │ Click │ 250 │ text1 │ sun1.opacity = (sun1.opacity / 100) * 90; │ 36 │ bold │ 100 │"
"│ │ │ ├────────┤ │ │ │ │ │ │"
"│ │ │ │ 1 │ │ │ │ │ │ │"
"│ │ │ ├────────┤ │ │ │ │ │ │"
"│ │ │ │ 3 │ │ │ │ │ │ │"
"│ │ ├────────────┼────────┤ │ │ │ │ │ │"
"│ │ │ asda │ 4 │ │ │ │ │ │ │"
"│ │ │ ├────────┤ │ │ │ │ │ │"
"│ │ │ │ aa │ │ │ │ │ │ │"
"│ │ ├────────────┼────────┤ │ │ │ │ │ │"
"│ │ │ 123132 │ 123132 │ │ │ │ │ │ │"
"│ │ │ ├────────┤ │ │ │ │ │ │"
"│ │ │ │ 11 │ │ │ │ │ │ │"
"└───────┴───────────┴────────────┴────────┴─────────┴───────┴───────────────────────────────────────────┴──────┴───────┴─────────┘"
);
test_table!(
collapse_object_orientation_test_4,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132"],
"data0": "",
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.collapse(),
"╔════════════╦═══════╦════════╦═══════╗"
"║ data ║ data0 ║ data1 ║ data2 ║"
"╠════════════╬═══════╬════════╬═══════╣"
"║ Click Here ║ ║ Click ║ C ║"
"║ ║ ╠════════╣ ║"
"║ ║ ║ 1 ║ ║"
"║ ║ ╠════════╬═══════╣"
"║ ║ ║ 3 ║ 1 ║"
"║ ║ ╠════════╬═══════╣"
"║ ║ ║ 4 ║ 3 ║"
"╠════════════║ ╠════════╬═══════╣"
"║ asda ║ ║ aa ║ 4 ║"
"║ ║ ╠════════╬═══════╣"
"║ ║ ║ 123132 ║ a ║"
"║ ║ ╠════════╣ ║"
"║ ║ ║ 11 ╠═══════╣"
"║ ║ ╠════════╣ 12 ║"
"║ ║ ║ 1 ║ ║"
"╠════════════║ ╠════════╬═══════╣"
"║ 123132 ║ ║ 1 ║ 11 ║"
"║ ║ ╠════════╣ ║"
"║ ║ ║ 1 ║ ║"
"║ ║ ╠════════╬═══════╣"
"║ ║ ║ 1 ║ 1 ║"
"║ ║ ╠════════╬═══════╣"
"║ ║ ║ 1 ║ 1 ║"
"╚════════════╩═══════╩════════╩═══════╝"
);
test_table!(
collapse_object_orientation_test_5,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.collapse(),
"╔════════════╦════════╦═══════╗"
"║ data ║ data1 ║ data2 ║"
"╠════════════╬════════╬═══════╣"
"║ Click Here ║ Click ║ C ║"
"║ ╠════════╣ ║"
"║ ║ 1 ║ ║"
"║ ╠════════╬═══════╣"
"║ ║ 3 ║ 1 ║"
"╠════════════╬════════╬═══════╣"
"║ asda ║ 4 ║ 3 ║"
"║ ╠════════╬═══════╣"
"║ ║ aa ║ 4 ║"
"║ ╠════════╬═══════╣"
"║ ║ 123132 ║ a ║"
"╠════════════╬════════╣ ║"
"║ 123132 ║ 11 ╠═══════╣"
"║ ╠════════╣ 12 ║"
"║ ║ 1 ║ ║"
"║ ╠════════╬═══════╣"
"║ ║ 1 ║ 11 ║"
"╠════════════╬════════╣ ║"
"║ 1 ║ 1 ║ ║"
"║ ╠════════╬═══════╣"
"║ ║ 1 ║ 1 ║"
"║ ╠════════╬═══════╣"
"║ ║ 1 ║ 1 ║"
"╚════════════╩════════╩═══════╝"
);
test_table!(
collapse_object_orientation_test_6,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], {"aa": "123132", "bb": "123132"}, [11, 1, 1, 1, 1, 1]],
"data2": { "11": {"x": "xxx"}, "22": 1 },
"data3": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.collapse(),
"╔════════════╦═════════════════╦══════════╦═══════╗"
"║ data ║ data1 ║ data2 ║ data3 ║"
"╠════════════╬═════════════════╬═════╦════╬═══════╣"
"║ Click Here ║ Click ║ 11 ║ 22 ║ C ║"
"║ ╠═════════════════╬═════╬════╣ ║"
"║ ║ 1 ║ x ║ 1 ║ ║"
"║ ╠═════════════════╬═════╣ ╠═══════╣"
"║ ║ 3 ║ xxx ║ ║ 1 ║"
"╠════════════╬═════════════════╣ ║ ╠═══════╣"
"║ asda ║ 4 ║ ║ ║ 3 ║"
"║ ╠════════╦════════╣ ║ ╠═══════╣"
"║ ║ aa ║ bb ║ ║ ║ 4 ║"
"║ ╠════════╬════════╣ ║ ╠═══════╣"
"║ ║ 123132 ║ 123132 ║ ║ ║ a ║"
"╠════════════╬════════╩════════╣ ║ ║ ║"
"║ 123132 ║ 11 ║ ║ ╠═══════╣"
"║ ╠═════════════════║ ║ ║ 12 ║"
"║ ║ 1 ║ ║ ║ ║"
"║ ╠═════════════════║ ║ ╠═══════╣"
"║ ║ 1 ║ ║ ║ 11 ║"
"╠════════════╬═════════════════║ ║ ║ ║"
"║ 1 ║ 1 ║ ║ ║ ║"
"║ ╠═════════════════║ ║ ╠═══════╣"
"║ ║ 1 ║ ║ ║ 1 ║"
"║ ╠═════════════════║ ║ ╠═══════╣"
"║ ║ 1 ║ ║ ║ 1 ║"
"╚════════════╩═════════════════╩═════╩════╩═══════╝"
);
test_table!(
collapse_object_array_orientation_test_1,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
"║ widget ║"
"╠═══════╦═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣"
"║ debug ║ text ║"
"╠═══════╬═══════════╦════════════════════════════╦═════════╦═══════╦═══════════════════════════════════════════╦══════╦═══════╦═════════╣"
"║ on ║ alignment ║ data ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║"
"║ ╠═══════════╬════════════╦══════╦════════╬═════════╬═══════╬═══════════════════════════════════════════╬══════╬═══════╬═════════╣"
"║ ║ center ║ Click Here ║ asda ║ 123132 ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║"
"╚═══════╩═══════════╩════════════╩══════╩════════╩═════════╩═══════╩═══════════════════════════════════════════╩══════╩═══════╩═════════╝"
);
test_table!(
collapse_object_array_orientation_test_2,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", {"123132": 11}],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗"
"║ widget ║"
"╠═══════╦═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣"
"║ debug ║ text ║"
"╠═══════╬═══════════╦════════════════════════════╦═════════════════════════════════╦═════════╦═══════╦═══════════════════════════════════════════╦══════╦═══════╦═════════╣"
"║ on ║ alignment ║ data ║ data1 ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║"
"║ ╠═══════════╬════════════╦══════╦════════╬═══════╦═══╦═══╦═══╦════╦════════╬═════════╬═══════╬═══════════════════════════════════════════╬══════╬═══════╬═════════╣"
"║ ║ center ║ Click Here ║ asda ║ 123132 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║"
"║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╠════════╣ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ 11 ║ ║ ║ ║ ║ ║ ║"
"╚═══════╩═══════════╩════════════╩══════╩════════╩═══════╩═══╩═══╩═══╩════╩════════╩═════════╩═══════╩═══════════════════════════════════════════╩══════╩═══════╩═════════╝"
);
test_table!(
collapse_object_array_orientation_test_3,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"data1": [["Click", "1", "3", "4"], "aa", "123132", 11],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}))
.with(Style::modern())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐"
"│ widget │"
"├───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤"
"│ debug │ text │"
"├───────┼───────────┬────────────────────────────┬──────────────────────────────────────┬─────────┬───────┬───────────────────────────────────────────┬──────┬───────┬─────────┤"
"│ on │ alignment │ data │ data1 │ hOffset │ name │ onMouseUp │ size │ style │ vOffset │"
"│ ├───────────┼────────────┬──────┬────────┼───────┬───┬───┬───┬────┬────────┬────┼─────────┼───────┼───────────────────────────────────────────┼──────┼───────┼─────────┤"
"│ │ center │ Click Here │ asda │ 123132 │ Click │ 1 │ 3 │ 4 │ aa │ 123132 │ 11 │ 250 │ text1 │ sun1.opacity = (sun1.opacity / 100) * 90; │ 36 │ bold │ 100 │"
"└───────┴───────────┴────────────┴──────┴────────┴───────┴───┴───┴───┴────┴────────┴────┴─────────┴───────┴───────────────────────────────────────────┴──────┴───────┴─────────┘"
);
test_table!(
collapse_object_array_orientation_test_4,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132"],
"data0": "",
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔════════════════════════════╦═══════╦══════════════════════════════════════════════════════════╦═════════════════════════════════════╗"
"║ data ║ data0 ║ data1 ║ data2 ║"
"╠════════════╦══════╦════════╬═══════╬═══════╦═══╦═══╦═══╦════╦════════╦════╦═══╦═══╦═══╦═══╦═══╬═══╦═══╦═══╦═══╦═══╦════╦════╦═══╦═══╣"
"║ Click Here ║ asda ║ 123132 ║ ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"╚════════════╩══════╩════════╩═══════╩═══════╩═══╩═══╩═══╩════╩════════╩════╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩════╩════╩═══╩═══╝"
);
test_table!(
collapse_object_array_orientation_test_5,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], ["aa", "123132"], [11, 1, 1, 1, 1, 1]],
"data2": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔════════════════════════════════╦══════════════════════════════════════════════════════════╦═════════════════════════════════════╗"
"║ data ║ data1 ║ data2 ║"
"╠════════════╦══════╦════════╦═══╬═══════╦═══╦═══╦═══╦════╦════════╦════╦═══╦═══╦═══╦═══╦═══╬═══╦═══╦═══╦═══╦═══╦════╦════╦═══╦═══╣"
"║ Click Here ║ asda ║ 123132 ║ 1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ 123132 ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"╚════════════╩══════╩════════╩═══╩═══════╩═══╩═══╩═══╩════╩════════╩════╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩════╩════╩═══╩═══╝"
);
test_table!(
collapse_object_array_orientation_test_6,
json_to_table(&json!({
"data": ["Click Here", "asda", "123132", "1"],
"data1": [["Click", "1", "3", "4"], {"aa": "123132", "bb": "123132"}, [11, 1, 1, 1, 1, 1]],
"data2": { "11": {"x": "xxx"}, "22": 1 },
"data3": [["C", "1", "3", "4"], ["a", "12"], [11, 1, 1]],
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔════════════════════════════════╦══════════════════════════════════════════════════════════════╦══════════╦═════════════════════════════════════╗"
"║ data ║ data1 ║ data2 ║ data3 ║"
"╠════════════╦══════╦════════╦═══╬═══════╦═══╦═══╦═══╦════════╦════════╦════╦═══╦═══╦═══╦═══╦═══╬═════╦════╬═══╦═══╦═══╦═══╦═══╦════╦════╦═══╦═══╣"
"║ Click Here ║ asda ║ 123132 ║ 1 ║ Click ║ 1 ║ 3 ║ 4 ║ aa ║ bb ║ 11 ║ 1 ║ 1 ║ 1 ║ 1 ║ 1 ║ 11 ║ 22 ║ C ║ 1 ║ 3 ║ 4 ║ a ║ 12 ║ 11 ║ 1 ║ 1 ║"
"║ ║ ║ ║ ║ ║ ║ ║ ╠════════╬════════╣ ║ ║ ║ ║ ║ ╠═════╬════╣ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ║ ║ 123132 ║ 123132 ║ ║ ║ ║ ║ ║ ║ x ║ 1 ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╠═════╣ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ xxx ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"╚════════════╩══════╩════════╩═══╩═══════╩═══╩═══╩═══╩════════╩════════╩════╩═══╩═══╩═══╩═══╩═══╩═════╩════╩═══╩═══╩═══╩═══╩═══╩════╩════╩═══╩═══╝"
);
test_table!(
collapse_object_array_orientation_test_7,
json_to_table(&json!({
"widget": {
"debug": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
},
"123": ["1123", "qwe", "sad"],
"2345": {
"debug1\ndebug1": "on",
"debug2": "on",
"text": {
"data": ["Click Here", "asda", "123132"],
"alignment": ";\n;\n;",
"onMouseUp": ";"
}
},
"132456": "1123",
"wwwww23": "1123",
}))
.with(Style::extended())
.object_orientation(Orientation::Row)
.array_orientation(Orientation::Row)
.collapse(),
"╔══════════════════╦════════╦══════════════════════════════════════════════════════════════════════╦═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╦═════════╗"
"║ 123 ║ 132456 ║ 2345 ║ widget ║ wwwww23 ║"
"╠══════╦═════╦═════╬════════╬════════╦════════╦════════════════════════════════════════════════════╬═══════╦═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╬═════════╣"
"║ 1123 ║ qwe ║ sad ║ 1123 ║ debug1 ║ debug2 ║ text ║ debug ║ text ║ 1123 ║"
"║ ║ ║ ║ ║ debug1 ║ ║ ╠═══════╬═══════════╦════════════════════════════╦═════════╦═══════╦═══════════════════════════════════════════╦══════╦═══════╦═════════╣ ║"
"║ ║ ║ ║ ╠════════╬════════╬═══════════╦════════════════════════════╦═══════════╣ on ║ alignment ║ data ║ hOffset ║ name ║ onMouseUp ║ size ║ style ║ vOffset ║ ║"
"║ ║ ║ ║ ║ on ║ on ║ alignment ║ data ║ onMouseUp ║ ╠═══════════╬════════════╦══════╦════════╬═════════╬═══════╬═══════════════════════════════════════════╬══════╬═══════╬═════════╣ ║"
"║ ║ ║ ║ ║ ║ ╠═══════════╬════════════╦══════╦════════╬═══════════╣ ║ center ║ Click Here ║ asda ║ 123132 ║ 250 ║ text1 ║ sun1.opacity = (sun1.opacity / 100) * 90; ║ 36 ║ bold ║ 100 ║ ║"
"║ ║ ║ ║ ║ ║ ║ ; ║ Click Here ║ asda ║ 123132 ║ ; ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ; ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"║ ║ ║ ║ ║ ║ ║ ; ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║"
"╚══════╩═════╩═════╩════════╩════════╩════════╩═══════════╩════════════╩══════╩════════╩═══════════╩═══════╩═══════════╩════════════╩══════╩════════╩═════════╩═══════╩═══════════════════════════════════════════╩══════╩═══════╩═════════╩═════════╝"
);