diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-04-30 08:46:48 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-04-30 09:13:52 -0400 |
commit | 692fb19037fff808d75477bbc3fb0bf933b4dc08 (patch) | |
tree | 22cf5af7fb15951b1ac531b53ce6fe28fce2e02e /tests | |
parent | b41dec4c10914344bc0395a8639aa25f672d6475 (diff) |
Add examples of within-line edit inference from #119, #140
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/examples/119-within-line-edits | 38 | ||||
-rwxr-xr-x | tests/examples/140-within-line-edits | 26 | ||||
-rwxr-xr-x | tests/examples/140-within-line-edits-counter-example | 28 |
3 files changed, 92 insertions, 0 deletions
diff --git a/tests/examples/119-within-line-edits b/tests/examples/119-within-line-edits new file mode 100755 index 00000000..1bea9c0b --- /dev/null +++ b/tests/examples/119-within-line-edits @@ -0,0 +1,38 @@ +#!/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/140-within-line-edits b/tests/examples/140-within-line-edits new file mode 100755 index 00000000..d2595518 --- /dev/null +++ b/tests/examples/140-within-line-edits @@ -0,0 +1,26 @@ +#!/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 new file mode 100755 index 00000000..b8913e90 --- /dev/null +++ b/tests/examples/140-within-line-edits-counter-example @@ -0,0 +1,28 @@ +#!/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 |