S3 paths like s3://test-bucket/test/.././/file are valid. . and .. have no special meaning in S3 keys.
In Trino project we have a test using S3Mock.
It currently uses S3Mock version 3.0.1 but also works great with 3.12.0, the latest 3.x line available on Docker Hub.
When running With S3Mock 4.0.0 (first 4.x) or 4.10.0 (latest 4.x currently available on Docker Hub) the test fails because s3://test-bucket/test/.././/file S3 path is rejected.