summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-08-05 16:34:22 -0400
committerDan Davison <dandavison7@gmail.com>2020-08-05 16:37:09 -0400
commitcfd6ed0e077f3667b036902516a0348b1c596441 (patch)
tree678a5bf6ad901fc269a4315dfb7267c8339489a6 /tests
parent2da099e53d5c0a7597757bca5b53bbef5d449e8b (diff)
Reorganize
Diffstat (limited to 'tests')
-rwxr-xr-xtests/diagnostics18
-rwxr-xr-xtests/examples/119-within-line-edits38
-rwxr-xr-xtests/examples/121-unrecognized-content-before-diff-12
-rwxr-xr-xtests/examples/121-unrecognized-content-before-diff-22
-rw-r--r--tests/examples/125-merge-conflict-1.diff48
-rw-r--r--tests/examples/125-merge-conflict-2.diff42
-rwxr-xr-xtests/examples/127-paths-with-spaces--added18
-rwxr-xr-xtests/examples/127-paths-with-spaces--renamed22
-rwxr-xr-xtests/examples/128-empty-file15
-rw-r--r--tests/examples/139-file-with-space-delimited-dash.diff7
-rwxr-xr-xtests/examples/140-within-line-edits26
-rwxr-xr-xtests/examples/140-within-line-edits-counter-example28
-rw-r--r--tests/examples/205-highlight-bug-1.diff7
-rw-r--r--tests/examples/205-highlight-bug-2.diff7
-rw-r--r--tests/examples/205-highlight-bug.diff19
-rw-r--r--tests/examples/55-unicode-width.diff17
-rwxr-xr-xtests/examples/56-unified-directory-diff10
-rwxr-xr-xtests/examples/60-submodule17
-rw-r--r--tests/examples/72-color-moved.diff22
-rwxr-xr-xtests/examples/93-binary16
20 files changed, 0 insertions, 381 deletions
diff --git a/tests/diagnostics b/tests/diagnostics
deleted file mode 100755
index 82a2f2b0..00000000
--- a/tests/diagnostics
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-commands=(
- "delta --version"
- "less --version | head -n1"
- "env | grep -E '(less|pager|bat)'"
- "printf '\e[34m\e[43mtext\e[m\n'"
- "printf '\e[38;5;19m\e[48;5;226mtext\e[m\n'"
- "printf '\e[38;2;0;0;255m\e[48;2;255;255;0mtext\e[m\n'"
- "delta <(echo a) <(echo b) | cat -A"
- "delta <(echo a) <(echo b)"
-)
-
-for cmd in "${commands[@]}"; do
- echo "> $cmd"
- eval "$cmd"
- echo
-done
diff --git a/tests/examples/119-within-line-edits b/tests/examples/119-within-line-edits
deleted file mode 100755
index 1bea9c0b..00000000
--- a/tests/examples/119-within-line-edits
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-git init
-git commit --allow-empty -m "Initial commit"
-
-cat > file1.js <<EOF
-{
- if(g_themeController == nullptr)
- {
-EOF
-
-cat > file2.js <<EOF
-myColor = color === control.palette.window ? themeController.themePalette.buttonColor
- : themeController.themePalette.windowColor
-EOF
-
-git add file1.js file2.js
-git commit -m "Base commit"
-
-cat > file1.js <<EOF
-{
- if(g_themeViewModel == nullptr)
- {
-EOF
-
-cat > file2.js <<EOF
-myColor = color === control.palette.window ? themeViewModel.themePalette.basicBase
- : themeViewModel.themePalette.windowColor
-EOF
-
-git add file1.js file2.js
-git commit -m "Changes"
-
-git log --patch
diff --git a/tests/examples/121-unrecognized-content-before-diff-1 b/tests/examples/121-unrecognized-content-before-diff-1
deleted file mode 100755
index c02c361e..00000000
--- a/tests/examples/121-unrecognized-content-before-diff-1
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-git show -p --cc --format= --numstat --stat
diff --git a/tests/examples/121-unrecognized-content-before-diff-2 b/tests/examples/121-unrecognized-content-before-diff-2
deleted file mode 100755
index 2d09108d..00000000
--- a/tests/examples/121-unrecognized-content-before-diff-2
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-git stash show --stat --patch
diff --git a/tests/examples/125-merge-conflict-1.diff b/tests/examples/125-merge-conflict-1.diff
deleted file mode 100644
index a13b761b..00000000
--- a/tests/examples/125-merge-conflict-1.diff
+++ /dev/null
@@ -1,48 +0,0 @@
-diff --cc src/config.rs
-index e35d2e4,fad673e..0000000
---- a/src/config.rs
-+++ b/src/config.rs
-@@@ -1,4 -1,5 +1,10 @@@
-++<<<<<<< Updated upstream
- +use std::process;
-++||||||| constructed merge base
-++=======
-+ use std::process;
-+
-++>>>>>>> Stashed changes
- use std::str::FromStr;
-
- use syntect::highlighting::{Color, Style, StyleModifier, Theme, ThemeSet};
-@@@ -78,7 -40,9 +84,15 @@@ pub fn get_config<'a>
- theme_set,
- );
-
-++<<<<<<< Updated upstream
- + let theme = if style::is_no_syntax_highlighting_theme_name(&theme_name) {
-++||||||| constructed merge base
-++ let theme = if is_no_syntax_highlighting_theme_name(&theme_name) {
-++=======
-+ println!("theme_name: {}", theme_name);
-+
-+ let theme = if is_no_syntax_highlighting_theme_name(&theme_name) {
-++>>>>>>> Stashed changes
- None
- } else {
- Some(&theme_set.themes[&theme_name])
-@@@ -190,10 -128,14 +204,14 @@@ fn get_is_light_mode_and_theme_name
- ) -> (bool, String) {
- let theme_arg = valid_theme_name_or_none(theme_arg, theme_set);
- let bat_theme_env_var = valid_theme_name_or_none(bat_theme_env_var, theme_set);
-+
-+ println!("theme_arg: {:?}", theme_arg);
-+ println!("bat_theme_env_var: {:?}", bat_theme_env_var);
-+
- match (theme_arg, bat_theme_env_var, light_mode_arg) {
- (None, None, false) => (false, style::DEFAULT_DARK_THEME.to_string()),
- - (Some(theme_name), _, false) => (is_light_theme(&theme_name), theme_name),
- - (None, Some(theme_name), false) => (is_light_theme(&theme_name), theme_name),
- + (Some(theme_name), _, false) => (style::is_light_theme(&theme_name), theme_name),
- + (None, Some(theme_name), false) => (style::is_light_theme(&theme_name), theme_name),
- (None, None, true) => (true, style::DEFAULT_LIGHT_THEME.to_string()),
- (Some(theme_name), _, is_light_mode) => (is_light_mode, theme_name),
- (None, Some(theme_name), is_light_mode) => (is_light_mode, theme_name),
diff --git a/tests/examples/125-merge-conflict-2.diff b/tests/examples/125-merge-conflict-2.diff
deleted file mode 100644
index 3fd66fac..00000000
--- a/tests/examples/125-merge-conflict-2.diff
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --cc Makefile
-index 759070d,3daf9eb..0000000
---- a/Makefile
-+++ b/Makefile
-@@@ -4,13 -4,16 +4,37 @@@ build
- lint:
- cargo clippy
-
-++<<<<<<< Updated upstream
- +test: unit-test end-to-end-test
- +
- +unit-test:
- + cargo test
- +
- +end-to-end-test: build
- + bash -c "diff -u <(git log -p) <(git log -p | target/release/delta --color-only | perl -pe 's/\e\[[0-9;]*m//g')"
-++||||||| constructed merge base
-++test:
-++ cargo test
-++ bash -c "diff -u <(git log -p) \
-++ <(git log -p | delta --width variable \
-++ --tabs 0 \
-++ --retain-plus-minus-markers \
-++ --commit-style plain \
-++ --file-style plain \
-++ --hunk-style plain \
-++ | ansifilter)"
-++=======
-+ test:
-+ cargo test --release
-+ bash -c "diff -u <(git log -p) \
-+ <(git log -p | target/release/delta --width variable \
-+ --tabs 0 \
-+ --retain-plus-minus-markers \
-+ --commit-style plain \
-+ --file-style plain \
-+ --hunk-style plain \
-+ | ansifilter)" > /dev/null
-++>>>>>>> Stashed changes
-
- release:
- @make -f release.Makefile release
diff --git a/tests/examples/127-paths-with-spaces--added b/tests/examples/127-paths-with-spaces--added
deleted file mode 100755
index 3a5096c2..00000000
--- a/tests/examples/127-paths-with-spaces--added
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-mkdir "with space"
-echo "file1 contents" > "with space/file1"
-
-mkdir "nospace"
-echo "file2 contents" > "nospace/file2"
-
-git init
-git commit --allow-empty -m "Initial commit"
-git add .
-git commit -m "Initial commit"
-
-git show
diff --git a/tests/examples/127-paths-with-spaces--renamed b/tests/examples/127-paths-with-spaces--renamed
deleted file mode 100755
index 740ce6e0..00000000
--- a/tests/examples/127-paths-with-spaces--renamed
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-mkdir "with space"
-echo "file1 contents" > "with space/file1"
-
-mkdir "nospace"
-echo "file2 contents" > "nospace/file2"
-
-git init
-git commit --allow-empty -m "Initial commit"
-git add .
-git commit -m "Initial commit"
-
-git mv "with space/file1" "with space/file1-renamed"
-git mv "nospace/file2" "nospace/file2-renamed"
-git commit -m "Rename"
-
-git show
diff --git a/tests/examples/128-empty-file b/tests/examples/128-empty-file
deleted file mode 100755
index a52bdb0c..00000000
--- a/tests/examples/128-empty-file
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-git init
-git commit --allow-empty -m "Initial commit"
-
-touch file
-
-git add file
-git commit -m "Initial commit"
-
-git show
diff --git a/tests/examples/139-file-with-space-delimited-dash.diff b/tests/examples/139-file-with-space-delimited-dash.diff
deleted file mode 100644
index 58963b0a..00000000
--- a/tests/examples/139-file-with-space-delimited-dash.diff
+++ /dev/null
@@ -1,7 +0,0 @@
-diff --git a/strange - file.txt b/strange - file.txt
-new file mode 100644
-index 0000000..9daeafb
---- /dev/null
-+++ b/strange - file.txt
-@@ -0,0 +1,1 @@
-+test
diff --git a/tests/examples/140-within-line-edits b/tests/examples/140-within-line-edits
deleted file mode 100755
index d2595518..00000000
--- a/tests/examples/140-within-line-edits
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-git init
-git commit --allow-empty -m "Initial commit"
-
-echo "did_emsg = FALSE;" > file.R
-
-git add file.R
-git commit -m "Base commit"
-
-echo "did_emsg == FALSE;" > file.R
-
-git add file.R
-git commit -m "Short change"
-
-git revert --no-edit HEAD
-
-echo "did_emsg = TRUE;" > file.R
-git add file.R
-git commit -m "Long change"
-
-git log --patch
diff --git a/tests/examples/140-within-line-edits-counter-example b/tests/examples/140-within-line-edits-counter-example
deleted file mode 100755
index b8913e90..00000000
--- a/tests/examples/140-within-line-edits-counter-example
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-
-repo=$(mktemp -d)
-cd $repo
-
-git init
-git commit --allow-empty -m "Initial commit"
-
-cat > file <<EOF
-aaaa a aaa
-bbbb b bbb
-cccc c ccc
-EOF
-
-git add file
-git commit -m "Base commit"
-
-cat > file <<EOF
-bbbb ! bbb
-dddd d ddd
-cccc ! ccc
-EOF
-
-git add file
-git commit -m "Changes"
-
-git log --patch
diff --git a/tests/examples/205-highlight-bug-1.diff b/tests/examples/205-highlight-bug-1.diff
deleted file mode 100644
index 2d0c38f1..00000000
--- a/tests/examples/205-highlight-bug-1.diff
+++ /dev/null
@@ -1,7 +0,0 @@
-diff --git a/b b/b
-index 1b647ff..b6467a2 100644
---- a/b
-+++ b/b
-@@ -1 +1 @@
--return parent_names
-+parent_names
diff --git a/tests/examples/205-highlight-bug-2.diff b/tests/examples/205-highlight-bug-2.diff
deleted file mode 100644
index 1c62a7b8..00000000
--- a/tests/examples/205-highlight-bug-2.diff
+++ /dev/null
@@ -1,7 +0,0 @@
-diff --git i/diff-test.txt w/diff-test.txt
-index 5fd0037..3f0bbd0 100644
---- i/diff-test.txt
-+++ w/diff-test.txt
-@@ -1,1 +1,1 @@
-- [
-+= (
diff --git a/tests/examples/205-highlight-bug.diff b/tests/examples/205-highlight-bug.diff
deleted file mode 100644
index b79a48cb..00000000
--- a/tests/examples/205-highlight-bug.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git i/diff-test.txt w/diff-test.txt
-index 5fd0037..3f0bbd0 100644
---- i/diff-test.txt
-+++ w/diff-test.txt
-@@ -1,6 +1,10 @@
--foo
-+foo yeah
- bar
--return parent_names + [self.tree_name.value]
-+parent_names += (self.tree_name.value,)
-+if include_module_names:
-+ skdjfh
-+ kjlkfjs
-+return parent_names
-
--foo
--bar
-+foo-one
-+bar-two
diff --git a/tests/examples/55-unicode-width.diff b/tests/examples/55-unicode-width.diff
deleted file mode 100644
index 4e2b1c82..00000000
--- a/tests/examples/55-unicode-width.diff
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/test.txt b/test.txt
-index 66a5cb0..0e8c1b9 100644
---- a/test.txt
-+++ b/test.txt
-@@ -1,1 +1,1 @@
--This is an English sentence. This is an English sentence. This is an English sentence. This is an English sentence. This is an English sentence.
-+This is an English sentence. This is an English sentence. This is an English sentence. This is an English sentence. This is an English sentence. some more words
-
--这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。
-+这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。这是一个汉语句子。多点字
-+
-+Another line of English
-+更多一行汉语
-+Another line of English
-+更多一行汉语
-+Another line of English
-+更多一行汉语
diff --git a/tests/examples/56-unified-directory-diff b/tests/examples/56-unified-directory-diff
deleted file mode 100755
index 650ed20d..00000000
--- a/tests/examples/56-unified-directory-diff
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-d1=$(mktemp -d)
-d2=$(mktemp -d)
-mkdir $d1 $d2
-git show HEAD~10:./src/delta.rs > $d1/a.rs
-git show HEAD:./src/delta.rs > $d2/a.rs
-touch $d2/b.rs
-git show HEAD~10:./src/paint.rs > $d1/c.rs
-git show HEAD:./src/paint.rs > $d2/c.rs
-diff -u $d1 $d2
diff --git a/tests/examples/60-submodule b/tests/examples/60-submodule
deleted file mode 100755
index c7830db5..00000000
--- a/tests/examples/60-submodule
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-submodule=$(mktemp -d)
-repo=$(mktemp -d)
-cd $submodule
-git init
-git commit --allow-empty -m "Initial commit"
-cd $repo
-git init
-git submodule add $submodule submodule
-git commit --allow-empty -m "Initial commit"
-touch submodule/a
-cat >> .git/config <<EOF
-[diff]
- submodule = log
-EOF
-git diff | cat
diff --git a/tests/examples/72-color-moved.diff b/tests/examples/72-color-moved.diff
deleted file mode 100644
index eb1f7c37..00000000
--- a/tests/examples/72-color-moved.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/a b/a
-index 283ba4ce..2c9304d5 100644
---- a/a
-+++ b/a
-@@ -3,12 +3,12 @@
- 1111 1111 1111 1111
- 1111 1111 1111 1111
- 
--2222 2222 2222 2222
--2222 2222 2222 2222
--2222 2222 2222 2222
--2222 2222 2222 2222
--
- 3333 3333 3333 3333
- 3333 3333 3333 3333
- 3333 3333 3333 3333
- 3333 3333 3333 3333
-+
-+2222 2222 2222 2222
-+2222 2222 2222 2222
-+2222 2222 2222 2222
-+2222 2222 2222 2222
diff --git a/tests/examples/93-binary b/tests/examples/93-binary
deleted file mode 100755
index 447ccdf6..00000000
--- a/tests/examples/93-binary
+++ /dev/null
@@ -1,16 +0,0 @@
-# Test script written by @gibfahn in https://github.com/dandavison/delta/issues/93
-dir=/tmp/tst
-rm -fr $dir && mkdir -p $dir && cd $dir
-git init
-echo hello > bar
-git add bar && git commit -m "added text file bar"
-echo -n -e \\x48\\x00\\x49\\x00 > foo
-git add foo
-GIT_PAGER="delta --theme=TwoDark" git diff --staged
-GIT_PAGER=less git diff --staged
-git commit -m "added binary file foo"
-echo -n -e \\x49\\x00\\x48\\x00 > foo
-git add foo
-git commit -m "changed binary file foo"
-GIT_PAGER="delta --theme=TwoDark" git log -p
-GIT_PAGER=less git log -p