From 6a7fd39a2958a17ebe136c87d19b3f9a4f8bfcb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Mon, 24 Jan 2022 09:39:04 +0100 Subject: [PATCH] Run test function `sort_fields` with new array handling https://github.com/metafacture/metafacture-fix/issues/100 --- data/review/sort_field/result.json | 28 +++++++++++++-------------- data/review/sort_field/sort_field.fix | 4 ++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/data/review/sort_field/result.json b/data/review/sort_field/result.json index 46e063a..3b01625 100644 --- a/data/review/sort_field/result.json +++ b/data/review/sort_field/result.json @@ -1,27 +1,27 @@ { - "animals" : [ "dog", "cat", "cat", "zebra" ], - "numbers" : [ "7", "2", "7", "1", "10" ], - "aumbers" : [ "7", "2", "1", "10" ], - "bnimals" : [ "dog", "cat", "zebra" ], - "bumbers" : [ "7", "2", "1", "10" ], + "animals" : [ "cat", "cat", "dog", "zebra" ], + "numbers" : [ "1", "10", "2", "7", "7" ], + "aumbers" : [ "1", "10", "2", "7" ], + "bnimals" : [ "cat", "dog", "zebra" ], + "bumbers" : [ "1", "10", "2", "7" ], "animols" : { "name" : "bird", - "cnimals" : [ "dog", "cat", "zebra" ], - "cumbers" : [ "7", "2", "1", "10" ] + "cnimals" : [ "cat", "dog", "zebra" ], + "cumbers" : [ "1", "10", "2", "7" ] }, "others" : [ { "name" : "Jake", - "dnimals" : [ "dog", "cat", "zebra" ], - "dumbers" : [ "7", "2", "1", "10" ] + "dnimals" : [ "cat", "dog", "zebra" ], + "dumbers" : [ "1", "10", "2", "7" ] } ], "OTHERS" : [ { "name" : "Jake", "enimals" : [ "dog", "cat", "zebra" ], "eumbers" : [ "7", "2", "1", "10" ] } ], - "xumbers" : [ "7", "7", "2", "1", "10", "1" ], - "ynimals" : [ "dog", "dog", "zebra", "cat", "zebra" ], - "yumbers" : [ "7", "7", "2", "1", "10", "1" ], - "znimals" : [ "dog", "dog", "zebra", "cat", "zebra" ], - "zumbers" : [ "7", "7", "2", "1", "10", "1" ] + "xumbers" : [ "1", "1", "10", "2", "7", "7" ], + "ynimals" : [ "cat", "dog", "dog", "zebra", "zebra" ], + "yumbers" : [ "1", "1", "10", "2", "7", "7" ], + "znimals" : [ "cat", "dog", "dog", "zebra", "zebra" ], + "zumbers" : [ "1", "1", "10", "2", "7", "7" ] } diff --git a/data/review/sort_field/sort_field.fix b/data/review/sort_field/sort_field.fix index 9a9c97d..3103360 100644 --- a/data/review/sort_field/sort_field.fix +++ b/data/review/sort_field/sort_field.fix @@ -2,6 +2,7 @@ sort_field("animals[]") sort_field("numbers[]") # Attributes with "1" is different to the metafacture approace with "true" +# All options do not work yet. sort_field("aumbers[]",numeric:"1") sort_field("bnimals[]",reverse:"1") sort_field("bumbers[]", numeric:"1",reverse:"1") @@ -10,6 +11,9 @@ sort_field("animols.cnimals[]") sort_field("animols.cumbers[]",numeric:"1") sort_field("others[].1.dnimals[]") sort_field("others[].1.dumbers[]",numeric:"1") + +# Selecting arrays with * does not work + sort_field("OTHERS[].*.enimals[]") sort_field("OTHERS[].*.eumbers[]",numeric:"1") sort_field("xumbers[]", uniq:"1")