Filtering...

octal-tests

books/std/strings/octal-tests
other
(in-package "STR")
other
(include-book "octal")
other
(include-book "std/testing/assert-bang" :dir :system)
other
(assert! (and (equal (oct-digit-char-value #\0) 0)
    (equal (oct-digit-char-value #\1) 1)
    (equal (oct-digit-char-value #\2) 2)
    (equal (oct-digit-char-value #\3) 3)
    (equal (oct-digit-char-value #\4) 4)
    (equal (oct-digit-char-value #\5) 5)
    (equal (oct-digit-char-value #\6) 6)
    (equal (oct-digit-char-value #\7) 7)))
other
(assert! (and (equal (oct-digit-chars-value (coerce "0" 'list)) 0)
    (equal (oct-digit-chars-value (coerce "6" 'list)) 6)
    (equal (oct-digit-chars-value (coerce "12" 'list)) 10)
    (equal (oct-digit-chars-value (coerce "1234" 'list))
      668)))
other
(assert! (equal (strval8 "") nil))
other
(assert! (equal (strval8 "0") 0))
other
(assert! (equal (strval8 "1234") 668))