| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -29,8 +29,9 @@ def test_check(self): | |
| self.assertFalse(check(3)) | ||
| self.assertFalse(check([])) | ||
| self.assertFalse(check(object())) | ||
| self.assertTrue(check(b'')) | ||
|
|
||
| # CRASHES check(NULL) | ||
| # CRASHES check(NULL) #PyBytes_Check() expects PyObject* | ||
|
|
||
| def test_checkexact(self): | ||
| # Test PyBytes_CheckExact() | ||
| Expand All | @@ -43,8 +44,9 @@ def test_checkexact(self): | |
| self.assertFalse(check(3)) | ||
| self.assertFalse(check([])) | ||
| self.assertFalse(check(object())) | ||
| self.assertTrue(check(b'')) | ||
|
Comment thread
vstinner marked this conversation as resolved.
Resolved
|
||
|
|
||
| # CRASHES check(NULL) | ||
| # CRASHES check(NULL) #PyBytes_CheckExact() expects PyObject* | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityHow are these comments related? They should probably be on two lines.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityApologies; that was meant to explain why it crashes (it felt a little vague whether or not it was expected behavior). Would it be better on the next line, or in parenthesis or similar?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Then it should be on the same line, but without the #, as that makes it seem like 2 different notes.
Sorry, something went wrong.
All reactions
|
||
|
|
||
| def test_fromstringandsize(self): | ||
| # Test PyBytes_FromStringAndSize() | ||
| Expand Down Expand Up | @@ -73,7 +75,7 @@ def test_fromstring(self): | |
| self.assertEqual(fromstring(b'abc\0def'), b'abc') | ||
| self.assertEqual(fromstring(b''), b'') | ||
|
|
||
| # CRASHES fromstring(NULL) | ||
| # CRASHES fromstring(NULL) | ||
|
Comment thread
abstractedfox marked this conversation as resolved.
Resolved
|
||
|
|
||
| def test_fromobject(self): | ||
| # Test PyBytes_FromObject() | ||
| Expand Down Expand Up | @@ -108,6 +110,7 @@ def test_asstring(self): | |
|
|
||
| self.assertEqual(asstring(b'abc', 4), b'abc\0') | ||
| self.assertEqual(asstring(b'abc\0def', 8), b'abc\0def\0') | ||
| self.assertEqual(asstring(b'', 1), b'\0') | ||
| self.assertRaises(TypeError, asstring, 'abc', 0) | ||
| self.assertRaises(TypeError, asstring, object(), 0) | ||
|
|
||
| Expand All | @@ -120,6 +123,7 @@ def test_asstringandsize(self): | |
|
|
||
| self.assertEqual(asstringandsize(b'abc', 4), (b'abc\0', 3)) | ||
| self.assertEqual(asstringandsize(b'abc\0def', 8), (b'abc\0def\0', 7)) | ||
| self.assertEqual(asstringandsize(b'', 1), (b'\0', 0)) | ||
| self.assertEqual(asstringandsize_null(b'abc', 4), b'abc\0') | ||
| self.assertRaises(ValueError, asstringandsize_null, b'abc\0def', 8) | ||
| self.assertRaises(TypeError, asstringandsize, 'abc', 0) | ||
| Expand Down Expand Up | @@ -163,6 +167,7 @@ def test_concat(self, concat=None): | |
| self.assertEqual(concat(b'', bytearray(b'def')), b'def') | ||
| self.assertEqual(concat(memoryview(b'xabcy')[1:4], b'def'), b'abcdef') | ||
| self.assertEqual(concat(b'abc', memoryview(b'xdefy')[1:4]), b'abcdef') | ||
| self.assertEqual(concat(b'', b''), b'') | ||
|
|
||
| self.assertEqual(concat(b'abc', b'def', True), b'abcdef') | ||
| self.assertEqual(concat(b'abc', bytearray(b'def'), True), b'abcdef') | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.