Assuming you're using GNU sort, use the-V option:
-V
-V, --version-sort natural sort of (version) numbers within text
For your input, it'd produce:
test1.pdftest2.pdftest10.pdf