]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_softspace.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / test_softspace.py
CommitLineData
4710c53d 1from test.test_support import run_unittest\r
2import unittest\r
3import StringIO\r
4\r
5class SoftspaceTests(unittest.TestCase):\r
6 def test_bug_480215(self):\r
7 # SF bug 480215: softspace confused in nested print\r
8 f = StringIO.StringIO()\r
9 class C:\r
10 def __str__(self):\r
11 print >> f, 'a'\r
12 return 'b'\r
13\r
14 print >> f, C(), 'c ', 'd\t', 'e'\r
15 print >> f, 'f', 'g'\r
16 # In 2.2 & earlier, this printed ' a\nbc d\te\nf g\n'\r
17 self.assertEqual(f.getvalue(), 'a\nb c d\te\nf g\n')\r
18\r
19def test_main():\r
20 run_unittest(SoftspaceTests)\r
21\r
22if __name__ == '__main__':\r
23 test_main()\r