From 49c292e4b32f26ba9562d009753bf75c13a13f2b Mon Sep 17 00:00:00 2001 From: Marcelo Glasberg <13332110+marcglasberg@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:26:31 -0300 Subject: [PATCH] Update json_serialization_and_deserialization_test.dart --- ...serialization_and_deserialization_test.dart | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart b/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart index d96927d..554ba7d 100644 --- a/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart +++ b/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart @@ -36,11 +36,19 @@ void main() { test('can deserialize IList of enums', () { expect(IListWrapper2.fromJson({'iList': []}).iList, IList([])); - expect( - IListWrapper2.fromJson({ - 'iList': [TestEnum.valA, TestEnum.valB, TestEnum.valC] - }).iList, - IList([TestEnum.valA, TestEnum.valB, TestEnum.valC])); + + IList result; + try { + result = IListWrapper2.fromJson({ + 'iList': ['valA', 'valB', 'valC'] + }).iList; + } catch (e) { + result = IListWrapper2.fromJson({ + 'iList': [TestEnum.valA, TestEnum.valB, TestEnum.valC] + }).iList; + } + + expect(result, IList([TestEnum.valA, TestEnum.valB, TestEnum.valC])); }); });