Skip to content

Commit

Permalink
[wip] files
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Mar 7, 2024
1 parent 4418eec commit 173501b
Show file tree
Hide file tree
Showing 2 changed files with 378 additions and 0 deletions.
348 changes: 348 additions & 0 deletions test/difftastic-next-file.erts
Original file line number Diff line number Diff line change
@@ -0,0 +1,348 @@
Code: difftastic-next-file

Name: difftastic-next-file:file-wo-chunks-to-file-wo-chunks-1
Point-Char: |
=-=
|difftastic.el --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:file-wo-chunks-to-file-wo-chunks-2
Point-Char: |
=-=
difftastic.el| --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:file-wo-chunks-to-file-wo-chunks-3
Point-Char: |
=-=
difftastic.el --- Emacs Lisp
|1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:last-chunk-to-file-wo-chunks-1
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

|difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:last-chunk-to-file-wo-chunks-2
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Li|sp
9 ;; Version: 0.0.0

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:last-chunk-to-file-wo-chunks-3
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0|

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:first-chunk-to-file-wo-chunks-1
Point-Char: |
=-=
|difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:first-chunk-to-file-wo-chunks-2
Point-Char: |
=-=
difftastic.e|l --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:first-chunk-to-file-wo-chunks-3
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el| --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-
=-=-=

Name: difftastic-next-file:last-chunk-to-file-with-chunks-1
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

|difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=

Name: difftastic-next-file:last-chunk-to-file-with-chunks-2
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp|
9 ;; Version: 0.0.0

test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=

Name: difftastic-next-file:last-chunk-to-file-with-chunks-3
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0
|
test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=
Name: difftastic-next-file:first-chunk-to-file-with-chunks-1
Point-Char: |
=-=
|difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=

Name: difftastic-next-file:last-chunk-to-file-with-chunks-2
Point-Char: |
=-=
difftastic.el --- 1/2 --- Ema|cs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=

Name: difftastic-next-file:last-chunk-to-file-with-chunks-3
Point-Char: |
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for |difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=
difftastic.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-

difftastic.el --- 2/2 --- Emacs Lisp
9 ;; Version: 0.0.0

|test/difftastic.t.el --- 1/2 --- Emacs Lisp
1 ;;; difftastic.t.el --- Tests for difftastic -*- lexical-binding: t; -*-

test/difftastic.t.el --- 2/2 --- Emacs Lisp
5 (require 'difftastic)
=-=-=
30 changes: 30 additions & 0 deletions test/difftastic.t.el
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,36 @@
:type 'user-error)
(should (equal (point-min) (point))))))

(ert-deftest difftastic-next-file:erts-scenarios ()
(when (fboundp 'ert-test-erts-file) ;; since Emacs-29
(mocklet ((difftastic--get-languages => '("Text" "Emacs Lisp" "C++" "Java")))
(let ((file "difftastic-next-file.erts")
scenarios)
(should (or (file-exists-p file)
(file-exists-p (format "test/%s" file))))
(setq scenarios (if (file-exists-p file)
file
(format "test/%s" file)))
(ert-test-erts-file scenarios)))))

(ert-deftest difftastic-next-file:empty-buffer-error-signaled ()
(mocklet ((difftastic--get-languages => '("Text" "Emacs Lisp" "C++" "Java")))
(with-temp-buffer
(difftastic-mode)
(should-error (difftastic-next-file)
:type 'user-error))))

(ert-deftest difftastic-next-file:last-chunk-error-signaled ()
(mocklet ((difftastic--get-languages => '("Text" "Emacs Lisp" "C++" "Java")))
(with-temp-buffer
(insert "difftastic.el --- Emacs Lisp
1 ;;; difftastic.el --- Wrapper for difftastic -*- lexical-binding: t; -*-")
(difftastic-mode)
(goto-char (point-min))
(should-error (difftastic-next-file)
:type 'user-error)
(should (equal (point-min) (point))))))

(ert-deftest difftastic-previous-chunk:erts-scenarios ()
(when (fboundp 'ert-test-erts-file) ;; since Emacs-29
(mocklet ((difftastic--get-languages => '("Text" "Emacs Lisp" "C++" "Java")))
Expand Down

0 comments on commit 173501b

Please sign in to comment.