@@ -28,8 +28,8 @@ def test_path_tuple(path: str | bytes, expected: tuple[bytes, ...]) -> None:
2828 except Exception as e :
2929 FAILED = True # pyright: ignore[reportConstantRedefinition]
3030 print ("fail" )
31- print (" " , end = "" )
32- print (e )
31+ print (" " , end = "" , file = sys . stderr )
32+ print (e , file = sys . stderr )
3333
3434
3535def _eval_or_False (source : str ) -> Any : # pyright: ignore[reportExplicitAny, reportAny] # noqa: ANN401
@@ -51,7 +51,7 @@ def _assert(source: str, debug: Callable[[], Any] | None = None) -> None: # pyr
5151 FAILED = True # pyright: ignore[reportConstantRedefinition]
5252 print ("fail" )
5353 if debug is not None :
54- print (f" { debug ()} " )
54+ print (f" { debug ()} " , file = sys . stderr )
5555
5656
5757def test_magic_error (f : BufferedReader ) -> None :
@@ -68,8 +68,8 @@ def test_magic_error(f: BufferedReader) -> None:
6868 except Exception as e :
6969 FAILED = True # pyright: ignore[reportConstantRedefinition]
7070 print ("fail" )
71- print (" " , end = "" )
72- print (e )
71+ print (" " , end = "" , file = sys . stderr )
72+ print (e , file = sys . stderr )
7373
7474
7575def test_root_inode (volume : ext4 .Volume ) -> None :
@@ -82,8 +82,8 @@ def test_root_inode(volume: ext4.Volume) -> None:
8282 except ext4 .struct .ChecksumError as e :
8383 FAILED = True # pyright: ignore[reportConstantRedefinition]
8484 print ("fail" )
85- print (" " , end = "" )
86- print (e )
85+ print (" " , end = "" , file = sys . stderr )
86+ print (e , file = sys . stderr )
8787
8888
8989print ("check ext4.Volume stream validation: " , end = "" )
@@ -98,8 +98,8 @@ def test_root_inode(volume: ext4.Volume) -> None:
9898except Exception as e :
9999 FAILED = True # pyright: ignore[reportConstantRedefinition]
100100 print ("fail" )
101- print (" " , end = "" )
102- print (e )
101+ print (" " , end = "" , file = sys . stderr )
102+ print (e , file = sys . stderr )
103103
104104test_path_tuple ("/" , tuple ())
105105test_path_tuple (b"/" , tuple ())
@@ -162,6 +162,10 @@ def test_root_inode(volume: ext4.Volume) -> None:
162162 _ = b .seek (0 )
163163 _assert (f"b.read({ x } ) == { data [:x ]} " , lambda : b .seek (0 ) == 0 and b .read (x ))
164164
165+ inode = cast (ext4 .SymbolicLink , volume .inode_at ("/symlink.txt" ))
166+ _assert ("isinstance(inode, ext4.SymbolicLink)" )
167+ _assert ('inode.readlink() == b"test.txt"' , inode .readlink )
168+
165169img_file = "test_htree.ext4"
166170print (f"Testing image: { img_file } " )
167171with open (img_file , "rb" ) as f :
0 commit comments