summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-11-28 18:38:26 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-11-29 08:12:11 -0500
commit60ae4ac4cf481e49f5ccbc4c97c95bb961620d61 (patch)
tree57524d0e9b99f2541d5601e18762ac2500b919c1 /tests
parentb8dbc92ab571d88f9d9dca4a61ade2492c6e0642 (diff)
downloadpango-60ae4ac4cf481e49f5ccbc4c97c95bb961620d61.tar.gz
serializer: Support tab alignments
Serialize tab alignment in addition to tab position. We still accept the old format and default alignment to left. Update testserialize and layout tests for this.
Diffstat (limited to 'tests')
-rw-r--r--tests/layouts/valid-12.layout25
-rw-r--r--tests/layouts/valid-13.layout25
-rw-r--r--tests/testserialize.c17
3 files changed, 54 insertions, 13 deletions
diff --git a/tests/layouts/valid-12.layout b/tests/layouts/valid-12.layout
index cc647178..bbe9a576 100644
--- a/tests/layouts/valid-12.layout
+++ b/tests/layouts/valid-12.layout
@@ -21,11 +21,26 @@
"tabs" : {
"positions-in-pixels" : true,
"positions" : [
- 0,
- 50,
- 100,
- 150,
- 200
+ {
+ "position" : 0,
+ "alignment" : "left"
+ },
+ {
+ "position" : 50,
+ "alignment" : "left"
+ },
+ {
+ "position" : 100,
+ "alignment" : "left"
+ },
+ {
+ "position" : 150,
+ "alignment" : "left"
+ },
+ {
+ "position" : 200,
+ "alignment" : "left"
+ }
]
},
"output" : {
diff --git a/tests/layouts/valid-13.layout b/tests/layouts/valid-13.layout
index 7b70a602..bc20a3c1 100644
--- a/tests/layouts/valid-13.layout
+++ b/tests/layouts/valid-13.layout
@@ -21,11 +21,26 @@
"tabs" : {
"positions-in-pixels" : true,
"positions" : [
- 0,
- 50,
- 100,
- 150,
- 200
+ {
+ "position" : 0,
+ "alignment" : "left"
+ },
+ {
+ "position" : 50,
+ "alignment" : "left"
+ },
+ {
+ "position" : 100,
+ "alignment" : "left"
+ },
+ {
+ "position" : 150,
+ "alignment" : "left"
+ },
+ {
+ "position" : 200,
+ "alignment" : "left"
+ }
]
},
"single-paragraph" : true,
diff --git a/tests/testserialize.c b/tests/testserialize.c
index 4ea7425e..325338f1 100644
--- a/tests/testserialize.c
+++ b/tests/testserialize.c
@@ -86,6 +86,7 @@ test_serialize_tab_array (void)
"0px 10px 100px 200px 400px",
" 0 10 ",
"20 10",
+ "left:10px right:20px center:30px decimal:40px",
""
};
const char *roundtripped[] = {
@@ -93,6 +94,7 @@ test_serialize_tab_array (void)
"0px 10px 100px 200px 400px",
"0 10",
"20 10",
+ "10px right:20px center:30px decimal:40px",
""
};
const char *invalid[] = {
@@ -231,9 +233,18 @@ test_serialize_layout_valid (void)
" \"tabs\" : {\n"
" \"positions-in-pixels\" : true,\n"
" \"positions\" : [\n"
- " 0,\n"
- " 50,\n"
- " 100\n"
+ " {\n"
+ " \"position\" : 0,\n"
+ " \"alignment\" : \"left\"\n"
+ " },\n"
+ " {\n"
+ " \"position\" : 50,\n"
+ " \"alignment\" : \"center\"\n"
+ " },\n"
+ " {\n"
+ " \"position\" : 100,\n"
+ " \"alignment\" : \"right\"\n"
+ " }\n"
" ]\n"
" },\n"
" \"alignment\" : \"center\",\n"