[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste f221c1a 104/298: Added test for pasting entire bu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste f221c1a 104/298: Added test for pasting entire buffers and regions |
Date: |
Thu, 9 Dec 2021 18:59:53 -0500 (EST) |
branch: elpa/webpaste
commit f221c1accd4faaf595b693d41e04341f89a6e9d5
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Added test for pasting entire buffers and regions
---
test/webpaste-test.el | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/test/webpaste-test.el b/test/webpaste-test.el
index d9cfe42..5c54bbd 100644
--- a/test/webpaste-test.el
+++ b/test/webpaste-test.el
@@ -2,10 +2,34 @@
;;; Commentary:
;;; Code:
(require 'ert)
+(require 'cl-lib)
(require 'webpaste)
+(ert-deftest webpaste-test/paste-region-and-buffer ()
+ "Test pasting of regions and buffers."
+
+ ;; Override pasting function to just return the inserted string
+ (cl-letf (((symbol-function 'webpaste-paste-text)
+ (lambda (text) text)))
+
+ ;; Set up a temporary buffer
+ (with-temp-buffer
+ ;; With README as content
+ (insert-file-contents "README.org")
+
+ ;; And make sure that the paste buffer function returns the same as we
had
+ ;; in the buffer.
+ (should (equal (webpaste-paste-buffer) (buffer-string)))
+
+ ;; Test so webpaste-paste-region selects the same part of the buffer as
to
+ ;; be expected.
+ (should (equal (webpaste-paste-region 10 100)
+ (buffer-substring 10 100))))))
+
+
+
(ert-deftest webpaste-test/return-url ()
"Test returning of URL's to the user."
- [nongnu] elpa/webpaste c9d1de0 076/298: Added Makefile for running tests, (continued)
- [nongnu] elpa/webpaste c9d1de0 076/298: Added Makefile for running tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7770c88 080/298: Added first unit test to detect a working provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 20760ac 097/298: Set default value of :parser to provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e998ee4 099/298: Simplify one unit test, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e905bbc 066/298: Change value-type to catch-all sexp since it's not functions anymore, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b4c08a5 070/298: Spelling in docs, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste dc11b51 078/298: Added code for helper for unit tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8e9f4e0 094/298: Bump required version for webpaste.el because I can't install older, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0b7ba72 098/298: Added coveralls for file coverage testing, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 25ea405 103/298: Added ERT test for message when returning URL, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f221c1a 104/298: Added test for pasting entire buffers and regions,
ELPA Syncer <=
- [nongnu] elpa/webpaste acf9676 108/298: Added flag to disable failover for provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4867c58 113/298: Backquotes for compacter list, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8f37214 116/298: Update docs to match function, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4dd2e1b 111/298: First test of creation of paste providers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0b67c54 117/298: Move code up to be defined before the webpaste-provider function, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e11ce74 086/298: Refactor provider priority to own function, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b2ffe99 091/298: Added emacs --version to output in build, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 993db7e 095/298: Added ptpb.pw as new and default provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 8861ed8 102/298: Added license-badge, renamed test-vars, stop providing webpaste-test, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste bdc204d 055/298: Autoload return function to always have it available, ELPA Syncer, 2021/12/09