Skip to content

Commit

Permalink
Add examples of within-line edit inference from #119, #140
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Apr 30, 2020
1 parent b41dec4 commit 692fb19
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/examples/119-within-line-edits
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions tests/examples/140-within-line-edits
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions tests/examples/140-within-line-edits-counter-example
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 692fb19

Please sign in to comment.