| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aad438b commit 22c7970
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1997,12 +1997,15 @@ def test_dynamic_color_pairs(self): | |||
| 1997 | 1997 | pair = curses.alloc_pair(fg, bg) | |
| 1998 | 1998 | self.assertGreater(pair, 0) | |
| 1999 | 1999 | self.assertEqual(curses.pair_content(pair), (fg, bg)) | |
| 2000 | - # The same combination of colors reuses the same pair. | ||
| 2001 | - self.assertEqual(curses.alloc_pair(fg, bg), pair) | ||
| 2002 | - self.assertEqual(curses.find_pair(fg, bg), pair) | ||
| 2003 | - # Once freed, the pair is no longer found. | ||
| 2004 | - self.assertIsNone(curses.free_pair(pair)) | ||
| 2005 | - self.assertEqual(curses.find_pair(fg, bg), -1) | ||
| 2000 | + if getattr(curses, 'ncurses_version', (6, 3)) >= (6, 3): | ||
| 2001 | + # The same combination of colors reuses the same pair. | ||
| 2002 | + self.assertEqual(curses.alloc_pair(fg, bg), pair) | ||
| 2003 | + self.assertEqual(curses.find_pair(fg, bg), pair) | ||
| 2004 | + # Once freed, the pair is no longer found. | ||
| 2005 | + self.assertIsNone(curses.free_pair(pair)) | ||
| 2006 | + self.assertEqual(curses.find_pair(fg, bg), -1) | ||
| 2007 | + else: | ||
| 2008 | + self.assertIsNone(curses.free_pair(pair)) | ||
| 2006 | 2009 | ||
| 2007 | 2010 | # Error paths. | |
| 2008 | 2011 | for color in self.bad_colors2(): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments