comparison tests/automated/lisp-tests.el @ 5360:46b53e84ea7a

#'substring-no-properties: check STRING's type, get_string_range_char won't. src/ChangeLog addition: 2011-02-24 Aidan Kehoe <kehoea@parhasard.net> * fns.c (Fsubstring_no_properties): Sigh, get_string_range_char checks the type of its START and END arguments, but doesn't check the type of its STRING argument. Thank you Raymond Toy! tests/ChangeLog addition: 2011-02-24 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el (substring-no-properties): Make sure this function checks its arguments' types, the absence of which was revealed by Raymond Toy's bug report of http://mid.gmane.org/4D65D413.5050103@gmail.com .
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 24 Feb 2011 09:36:19 +0000
parents 70b15ac66ee5
children 4c4b96b13f70
comparison
equal deleted inserted replaced
5359:f5a5501814f5 5360:46b53e84ea7a
1336 (Assert (equal (subseq '(1 2 3 4) -3 nil) '(2 3 4))) 1336 (Assert (equal (subseq '(1 2 3 4) -3 nil) '(2 3 4)))
1337 1337
1338 (Check-Error wrong-type-argument (subseq 3 2)) 1338 (Check-Error wrong-type-argument (subseq 3 2))
1339 (Check-Error args-out-of-range (subseq [1 2 3] -42)) 1339 (Check-Error args-out-of-range (subseq [1 2 3] -42))
1340 (Check-Error args-out-of-range (subseq [1 2 3] 0 42)) 1340 (Check-Error args-out-of-range (subseq [1 2 3] 0 42))
1341
1342 (Check-Error wrong-type-argument (substring-no-properties nil 4))
1343 (Check-Error wrong-type-argument (substring-no-properties "hi there" pi))
1344 (Check-Error wrong-type-argument (substring-no-properties "hi there" 0))
1341 1345
1342 ;;----------------------------------------------------- 1346 ;;-----------------------------------------------------
1343 ;; Time-related tests 1347 ;; Time-related tests
1344 ;;----------------------------------------------------- 1348 ;;-----------------------------------------------------
1345 (Assert (= (length (current-time-string)) 24)) 1349 (Assert (= (length (current-time-string)) 24))