From 8d377e4416cf5a7028c3311325f994ad1213bfa5 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 2 May 2020 00:06:55 +0200 Subject: [PATCH] Fix non-deterministic test on python <= 3.6 --- test/test_ircmsgs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_ircmsgs.py b/test/test_ircmsgs.py index 4b51ec9d0..b8d3f6786 100644 --- a/test/test_ircmsgs.py +++ b/test/test_ircmsgs.py @@ -32,6 +32,7 @@ from supybot.test import * import time import copy import pickle +import itertools import supybot.conf as conf import supybot.ircmsgs as ircmsgs @@ -161,7 +162,13 @@ class IrcMsgTestCase(SupyTestCase): self.assertEqual(m.args, ('me', 'Hello')) self.assertEqual(str(m), s + '\n') m._str = None # Clear the cache (set before parsing) - self.assertEqual(str(m), s + '\r\n') + + tag_set = [r'aaa=b\:bb', r'ccc', r'example.com/ddd=ee\\se'] + expected = [ + '@' + ';'.join(tags) + + ' :nick!ident@host.com PRIVMSG me :Hello\r\n' + for tags in itertools.permutations(tag_set)] + self.assertIn(str(m), expected) # bar\1 is equivalent to baz1 s = r'@foo=;bar=baz\1;qux= ' \