From bbad770cf2e569795715c9ec3c144812f126d870 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 24 Nov 2022 22:20:10 -0800 Subject: feat(wpcarro/emacs): Package bytes.el Another meh package, but let's finish the job and package it up. Change-Id: I7852a776c93c8c6717878a5ee0742287d2d23052 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7394 Reviewed-by: wpcarro Tested-by: BuildkiteCI --- users/wpcarro/emacs/pkgs/bytes/tests.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 users/wpcarro/emacs/pkgs/bytes/tests.el (limited to 'users/wpcarro/emacs/pkgs/bytes/tests.el') diff --git a/users/wpcarro/emacs/pkgs/bytes/tests.el b/users/wpcarro/emacs/pkgs/bytes/tests.el new file mode 100644 index 000000000000..9b71a466c736 --- /dev/null +++ b/users/wpcarro/emacs/pkgs/bytes/tests.el @@ -0,0 +1,18 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dependencies +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require 'ert) +(require 'bytes) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Tests +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(ert-deftest bytes-to-string () + (should (equal "1000B" (bytes-to-string 1000))) + (should (equal "2KB" (bytes-to-string (* 2 bytes-kb)))) + (should (equal "17MB" (bytes-to-string (* 17 bytes-mb)))) + (should (equal "419GB" (bytes-to-string (* 419 bytes-gb)))) + (should (equal "999TB" (bytes-to-string (* 999 bytes-tb)))) + (should (equal "2PB" (bytes-to-string (* 2 bytes-pb))))) -- cgit 1.4.1