@@ -223,15 +223,15 @@ TEST_F(TestFixedShapeTensorType, MetadataSerializationRoundtrip) {
223223 // Validate shape values must be integers. Error message should include the
224224 // JSON type name of the offending value.
225225 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":[3.5,4]})" ,
226- " shape must contain integers, got Number " );
226+ " shape must contain integers, got number " );
227227 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":["3","4"]})" ,
228- " shape must contain integers, got String " );
228+ " shape must contain integers, got string " );
229229 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":[null]})" ,
230- " shape must contain integers, got Null " );
230+ " shape must contain integers, got null " );
231231 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":[true]})" ,
232- " shape must contain integers, got True " );
232+ " shape must contain integers, got boolean " );
233233 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":[false]})" ,
234- " shape must contain integers, got False " );
234+ " shape must contain integers, got boolean " );
235235
236236 // Validate shape values must be non-negative
237237 CheckDeserializationRaises (ext_type_, fixed_size_list (int64 (), 1 ), R"( {"shape":[-1]})" ,
@@ -244,16 +244,20 @@ TEST_F(TestFixedShapeTensorType, MetadataSerializationRoundtrip) {
244244 // Validate permutation member must be an array with integer values
245245 CheckDeserializationRaises (ext_type_, storage_type,
246246 R"( {"shape":[3,4],"permutation":"invalid"})" ,
247- " permutation must be an array, got String " );
247+ " permutation must be an array, got string " );
248248 CheckDeserializationRaises (ext_type_, storage_type,
249249 R"( {"shape":[3,4],"permutation":{"a":1}})" ,
250- " permutation must be an array, got Object " );
250+ " permutation must be an array, got object " );
251251 CheckDeserializationRaises (ext_type_, storage_type,
252252 R"( {"shape":[3,4],"permutation":[1.5,0.5]})" ,
253- " permutation must contain integers, got Number " );
253+ " permutation must contain integers, got number " );
254254 CheckDeserializationRaises (ext_type_, storage_type,
255255 R"( {"shape":[3,4],"permutation":["a","b"]})" ,
256- " permutation must contain integers, got String" );
256+ " permutation must contain integers, got string" );
257+ // Validate permutation member must be an array with integer values
258+ CheckDeserializationRaises (ext_type_, storage_type,
259+ R"( {"shape":[3,4],"permutation":[]})" ,
260+ " Invalid permutation" );
257261
258262 // Validate permutation values must be unique integers in [0, N-1]
259263 CheckDeserializationRaises (ext_type_, storage_type,
@@ -269,13 +273,15 @@ TEST_F(TestFixedShapeTensorType, MetadataSerializationRoundtrip) {
269273 // Validate dim_names member must be an array with string values
270274 CheckDeserializationRaises (ext_type_, storage_type,
271275 R"( {"shape":[3,4],"dim_names":"invalid"})" ,
272- " dim_names must be an array, got String " );
276+ " dim_names must be an array, got string " );
273277 CheckDeserializationRaises (ext_type_, storage_type,
274278 R"( {"shape":[3,4],"dim_names":[1,2]})" ,
275- " dim_names must contain strings, got Number " );
279+ " dim_names must contain strings, got number " );
276280 CheckDeserializationRaises (ext_type_, storage_type,
277281 R"( {"shape":[3,4],"dim_names":[null,null]})" ,
278- " dim_names must contain strings, got Null" );
282+ " dim_names must contain strings, got null" );
283+ CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":[3,4],"dim_names":[]})" ,
284+ " Invalid dim_names" );
279285}
280286
281287TEST_F (TestFixedShapeTensorType, MakeValidatesShape) {
@@ -858,35 +864,41 @@ TEST_F(TestVariableShapeTensorType, MetadataSerializationRoundtrip) {
858864 CheckDeserializationRaises (ext_type_, storage_type, R"( {"shape":(3,4)})" ,
859865 " Invalid serialized JSON data" );
860866 CheckDeserializationRaises (ext_type_, storage_type, R"( {"permutation":[1,0]})" ,
861- " Invalid: permutation" );
867+ " Invalid permutation" );
862868 CheckDeserializationRaises (ext_type_, storage_type, R"( {"dim_names":["x","y"]})" ,
863- " Invalid: dim_names" );
869+ " Invalid dim_names" );
864870
865871 // Validate permutation member must be an array with integer values. Error
866872 // message should include the JSON type name of the offending value.
867873 CheckDeserializationRaises (ext_type_, storage_type, R"( {"permutation":"invalid"})" ,
868- " permutation must be an array, got String " );
874+ " permutation must be an array, got string " );
869875 CheckDeserializationRaises (ext_type_, storage_type, R"( {"permutation":[1.5,0.5,2.5]})" ,
870- " permutation must contain integers, got Number " );
876+ " permutation must contain integers, got number " );
871877 CheckDeserializationRaises (ext_type_, storage_type,
872878 R"( {"permutation":[null,null,null]})" ,
873- " permutation must contain integers, got Null" );
879+ " permutation must contain integers, got null" );
880+ CheckDeserializationRaises (ext_type_, storage_type, R"( {"permutation":[]})" ,
881+ " Invalid permutation" );
874882
875883 // Validate dim_names member must be an array with string values
876884 CheckDeserializationRaises (ext_type_, storage_type, R"( {"dim_names":"invalid"})" ,
877- " dim_names must be an array, got String " );
885+ " dim_names must be an array, got string " );
878886 CheckDeserializationRaises (ext_type_, storage_type, R"( {"dim_names":[1,2,3]})" ,
879- " dim_names must contain strings, got Number" );
887+ " dim_names must contain strings, got number" );
888+ CheckDeserializationRaises (ext_type_, storage_type, R"( {"dim_names":[]})" ,
889+ " Invalid dim_names" );
880890
881891 // Validate uniform_shape member must be an array with integer-or-null values
882892 CheckDeserializationRaises (ext_type_, storage_type, R"( {"uniform_shape":"invalid"})" ,
883- " uniform_shape must be an array, got String " );
893+ " uniform_shape must be an array, got string " );
884894 CheckDeserializationRaises (ext_type_, storage_type,
885895 R"( {"uniform_shape":[1.5,null,null]})" ,
886- " uniform_shape must contain integers or nulls, got Number " );
896+ " uniform_shape must contain integers or nulls, got number " );
887897 CheckDeserializationRaises (ext_type_, storage_type,
888898 R"( {"uniform_shape":["x",null,null]})" ,
889- " uniform_shape must contain integers or nulls, got String" );
899+ " uniform_shape must contain integers or nulls, got string" );
900+ CheckDeserializationRaises (ext_type_, storage_type, R"( {"uniform_shape":[]})" ,
901+ " Invalid uniform_shape" );
890902}
891903
892904TEST_F (TestVariableShapeTensorType, RoundtripBatch) {
0 commit comments