Skip to content

Commit

Permalink
Fix silly typo in int conversion. add more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
813gan committed Aug 15, 2024
1 parent a4ff0fd commit 25f5af2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion emacspy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ cdef class EmacsValue:
my_type = self.type()
if my_type == "string":
return self.str()
elif my_type == "intiger":
elif my_type == "integer":
return self.int()

def __str__(self):
Expand Down
8 changes: 8 additions & 0 deletions tests/test.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@
(ert-deftest ert-test-emacspy-duplicate-load ()
(should-error (progn (load "emacspy")
(load "emacspy"))))

(ert-deftest ert-test-emacspy-data-int ()
(should (py-set-global "test" 1 "test_int"))
(should (eq 1 (py-get-global-variable "test" "test_int")))
(should (py-set-global "test" -1 "test_int"))
(should (eq -1 (py-get-global-variable "test" "test_int")))
(should (py-set-global "test" 0 "test_int"))
(should (eq 0 (py-get-global-variable "test" "test_int"))) )

0 comments on commit 25f5af2

Please sign in to comment.