Skip to content

Commit d18100b

Browse files
committed
add test
1 parent fc84287 commit d18100b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/framework/filetools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,14 +926,16 @@ def test_back_up_file(self):
926926
self.assertEqual(ft.read_file(fp), new_txt)
927927

928928
# check whether strip_fn works as expected
929-
fp2 = fp + '.lua'
929+
fp2 = fp + 'a.lua'
930930
ft.copy_file(fp, fp2)
931931
res = ft.back_up_file(fp2)
932932
self.assertTrue(fp2.endswith('.lua'))
933933
self.assertTrue('.lua' in os.path.basename(res))
934934

935935
res = ft.back_up_file(fp2, strip_fn='.lua')
936936
self.assertFalse('.lua' in os.path.basename(res))
937+
# strip_fn should not remove the first a in 'a.lua'
938+
self.assertTrue(res.startswith(fp + 'a.bak_'))
937939

938940
def test_move_logs(self):
939941
"""Test move_logs function."""

0 commit comments

Comments
 (0)