#!/bin/sh

. libtest.sh
. libgit.sh

export LINES=35

steps '
	:6
	:enter
	:maximize
	:save-display default-diff.screen

	:12
	:stage-split-chunk
	:save-display split-diff.screen
'

in_work_dir create_dirty_workdir
in_work_dir sh -c 'printf "a CHANGED\n1\n2\nedited-too\n4\n5\nedited-too\n7\n8" > a'

test_tig status

assert_equals 'default-diff.screen' <<EOF
 a | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/a b/a
index 12d1d9e..931fee6 100644
--- a/a
+++ b/a
@@ -1,11 +1,9 @@
-a
+a CHANGED
 1
 2
-3
+edited-too
 4
 5
-6
+edited-too
 7
-8
-9
-10
\ No newline at end of file
+8
\ No newline at end of file








[stage] Press '<Enter>' to jump to file diff - line 1 of 25                 100%
EOF

assert_equals 'split-diff.screen' <<EOF
 a | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/a b/a
index 12d1d9e..931fee6 100644
--- a/a
+++ b/a
@@ -1,3 +1,3 @@
-a
+a CHANGED
 1
 2
@@ -2,5 +2,5 @@
 1
 2
-3
+edited-too
 4
 5
@@ -5,4 +5,4 @@
 4
 5
-6
+edited-too
 7
@@ -8,4 +8,1 @@
 7
-8
-9
-10
\ No newline at end of file
+8
\ No newline at end of file
[stage] Unstaged changes to 'a' - line 12 of 33                             100%
EOF
