mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #22668: Remove endianness assumption in test.
This commit is contained in:
		
							parent
							
								
									fa5d6a5ff3
								
							
						
					
					
						commit
						3c0cf05901
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -361,18 +361,20 @@ def test_reversed(self): | |||
|             self.assertEqual(list(reversed(m)), list(m[::-1])) | ||||
| 
 | ||||
|     def test_issue22668(self): | ||||
|         m = memoryview(bytes(range(8))) | ||||
|         a = array.array('H', [256, 256, 256, 256]) | ||||
|         x = memoryview(a) | ||||
|         m = x.cast('B') | ||||
|         b = m.cast('H') | ||||
|         c = b[0:2] | ||||
|         d = memoryview(b) | ||||
| 
 | ||||
|         del b | ||||
|      | ||||
|   | ||||
|         self.assertEqual(c[0], 256) | ||||
|         self.assertEqual(d[0], 256) | ||||
|         self.assertEqual(c.format, "H") | ||||
|         self.assertEqual(d.format, "H") | ||||
|      | ||||
|   | ||||
|         _ = m.cast('I') | ||||
|         self.assertEqual(c[0], 256) | ||||
|         self.assertEqual(d[0], 256) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Stefan Krah
						Stefan Krah