From f5d9a6b80610d122c3d6e8568b445636db2c72a8 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Mon, 8 Feb 2021 09:36:30 +0900 Subject: [PATCH] sets do not have stable ordering, so stop trying to print them in tests --- test/testSetLiterals.krk | 14 ++++++++++++-- test/testSetLiterals.krk.expect | 10 ++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/testSetLiterals.krk b/test/testSetLiterals.krk index 26b32f8..d54a73a 100644 --- a/test/testSetLiterals.krk +++ b/test/testSetLiterals.krk @@ -1,2 +1,12 @@ -print({1,2,3,object,True,None,"test"}) -print({str(i) for i in [1,2,3,object,print]}) +let s1 = {1,2,3,object,True,None,"test"} +print(1 in s1) +print(2 in s1) +print(3 in s1) +print(object in s1) +print(True in s1) +print(None in s1) +print("test" in s1) + +let l2 = [x for x in {str(i) for i in [1,2,3,object,True,None,"test"]}] +l2.sort() +print(l2) diff --git a/test/testSetLiterals.krk.expect b/test/testSetLiterals.krk.expect index d4c0f22..638044f 100644 --- a/test/testSetLiterals.krk.expect +++ b/test/testSetLiterals.krk.expect @@ -1,2 +1,8 @@ -{None, 1, 'test', , 3, 2} -{'1', '2', "", '3', ''} +True +True +True +True +True +True +True +['1', '2', '3', "", 'None', 'True', 'test']