HackerTrans
TopNewTrendsCommentsPastAskShowJobs

a-r-t

no profile record

comments

a-r-t
·10 bulan yang lalu·discuss
Nice to see a Festool miter saw in his shop, Lynch knew what he was doing.
a-r-t
·5 tahun yang lalu·discuss
One of the examples they provide on copilot.github.com shows a unit test for strip_suffix function. It does not test for a file name without a suffix, which the function would fail (it removes the last character instead):

    def strip_suffix(filename):
        """
        Removes the suffix from a filename
        """
        return filename[:filename.rfind('.')]

    import unittest

    def test_strip_suffix():
        """
        Tests for the strip_suffix function
        """
        assert strip_suffix('notes.txt') == 'notes'
        assert strip_suffix('notes.txt.gz') == 'notes.txt'