1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00
Commit Graph

1100 Commits

Author SHA1 Message Date
Rob Rix
43757e8a61 🔥 Categorizable.
This reverts commit be59b0c161362baae63308478177819828be7e1b.
2016-06-02 19:10:41 -04:00
Rob Rix
4ea9eba71c Merge branch 'master' into render-diff-summaries-as-json 2016-06-01 16:23:39 -04:00
Rob Rix
ef47e435aa Merge branch 'master' into benchmark-alignment
# Conflicts:
#	test/TermSpec.hs
2016-06-01 16:22:02 -04:00
Rob Rix
d1884c2908 Put the term generator sizing test into its own group. 2016-06-01 12:30:05 -04:00
joshvera
6bb2be56cc update fixtures 2016-06-01 12:17:07 -04:00
Rob Rix
6a7ec24640 Test that we generate terms of the specified size. 2016-06-01 11:52:43 -04:00
Rob Rix
2064d3af8a Depend on semantic-diff’s definition of ArbitraryTerm in the tests. 2016-06-01 09:16:47 -04:00
Rob Rix
ad8a6fd241 Simplify the definition of arbitrary over ArbitraryTerm. 2016-05-31 20:33:13 -04:00
Rob Rix
514c513f13 Simplify the definition of shrink over ArbitraryTerm. 2016-05-31 20:31:32 -04:00
Rob Rix
36168c1698 Rename unTerm to toTerm. 2016-05-31 20:29:12 -04:00
Rob Rix
484ed765f0 Use the field accessor to define unTerm. 2016-05-31 20:17:49 -04:00
Rob Rix
50c6c6c4fa Define a field accessor for ArbitraryTerm. 2016-05-31 20:17:42 -04:00
Rob Rix
2696635aa4 ArbitraryTerm uses the TermF type synonym. 2016-05-31 20:15:24 -04:00
Rob Rix
37f960b6d1 ArbitraryTerm wraps CofreeF. 2016-05-31 20:14:38 -04:00
joshvera
465da6bae5 one more 2016-05-31 17:02:24 -04:00
joshvera
55f286d8be Replace instance of comparable 2016-05-31 17:01:01 -04:00
joshvera
cf21fddc08 Fix up tests 2016-05-31 16:38:47 -04:00
Rob Rix
f1ff739394 Correct the types in the spec. 2016-05-31 16:15:40 -04:00
Rob Rix
2887d0c2a1 Merge branch 'master' into fix-invalid-slice 2016-05-31 13:28:50 -04:00
Rob Rix
07190fb6d1 Add a regression test for #573. 2016-05-30 19:04:16 -04:00
Rob Rix
8e45e5973d Correct the nested-insert fixture. 2016-05-30 13:54:33 -04:00
Rob Rix
f4ff8d0b89 Correct the insert fixture. 2016-05-30 13:54:28 -04:00
Rob Rix
49f477f5b0 📝 Verbatim. 2016-05-30 12:46:25 -04:00
Rob Rix
3fbfe43935 Prepend a newline to avoid being indented by expected:/but got:. 2016-05-30 12:44:09 -04:00
Rob Rix
89733ccdef Test the fixtures in Verbatim. 2016-05-30 12:42:43 -04:00
Rob Rix
643e37477f Derive an NFData instance for Verbatim. 2016-05-30 12:42:19 -04:00
Rob Rix
f10c0b305d Enable GeneralizedNewtypeDeriving. 2016-05-30 12:42:11 -04:00
Rob Rix
46b43c63e9 This is Text, now. 2016-05-30 12:40:41 -04:00
Rob Rix
7fe5be7fe2 Verbatim wraps Text. 2016-05-30 12:39:43 -04:00
Rob Rix
7a52507e94 Derive an Eq instance for Verbatim. 2016-05-30 12:39:39 -04:00
Rob Rix
3774bfb816 We treat this argument as a FilePath. 2016-05-30 12:38:21 -04:00
Rob Rix
d584832b6b We treat this argument as a FilePath. 2016-05-30 12:37:45 -04:00
Rob Rix
93b36a852f Add a Show instance for Verbatim which emits the unquoted string. 2016-05-30 12:37:05 -04:00
Rob Rix
58883000b1 Add a Verbatim newtype wrapping a String. 2016-05-30 12:36:52 -04:00
Rob Rix
160417d5a6 Move nested-insert out of the todos list. 2016-05-30 10:20:43 -04:00
Rob Rix
06c7437e66 Move insert out of the todos list. 2016-05-30 10:20:31 -04:00
Rob Rix
f77d8e023c Do the mapping all in one go. 2016-05-27 15:43:45 -04:00
Rob Rix
8ea9b44aef Traverse instead of sequenceA/fmap. 2016-05-27 15:43:14 -04:00
Rob Rix
a48404b53a Don’t use unionThese in the spec. 2016-05-27 15:42:36 -04:00
Rob Rix
0cbc8e514f Correct the fixtures for a couple of cases. 2016-05-27 15:30:39 -04:00
Rob Rix
ecb37f8f00 Correct the commented-out PrettyDiff full output thing. 2016-05-27 15:30:27 -04:00
Rob Rix
962b637d24 Update the asymmetrical-context fixture. 2016-05-27 15:16:50 -04:00
Rob Rix
1e6af52d35 Update the multiline-insert fixture. 2016-05-27 15:16:44 -04:00
Rob Rix
3351d2a2e3 Move the multiline-insert fixture into the done folder. 2016-05-27 15:16:22 -04:00
Rob Rix
ee9dd67bdf Move the asymmetrical-context test into the done dir. 2016-05-27 15:16:12 -04:00
Rob Rix
1153970864 Rebuild the other JSON fixtures now that we preserve ordering again. 2016-05-27 15:11:37 -04:00
Rob Rix
cdaa21d7d9 Move the newline-at-eof test into the functioning set. 2016-05-27 15:11:18 -04:00
Rob Rix
610d6e05da 🔥 some redundant imports. 2016-05-27 15:10:54 -04:00
Rob Rix
f60faefee5 🔥 a redundant import of Identity. 2016-05-27 14:05:29 -04:00
Rob Rix
14e9a3372f alignBranch takes a list of lines, not of aligned children. 2016-05-27 13:58:50 -04:00
Rob Rix
ebefc1c124 🔥 a redundant import. 2016-05-27 09:36:36 -04:00
Rob Rix
de6d7edec2 Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	semantic-diff.cabal
#	src/Alignment.hs
#	src/Control/Comonad/Cofree.hs
#	src/Data/Adjoined.hs
#	src/Diffing.hs
#	src/Interpreter.hs
#	src/Prologue.hs
#	src/Renderer/JSON.hs
#	src/Renderer/Patch.hs
#	src/Renderer/Split.hs
#	src/SplitDiff.hs
#	src/Term.hs
#	test/AlignmentSpec.hs
#	test/ArbitraryTerm.hs
#	test/PatchOutputSpec.hs
2016-05-27 09:35:26 -04:00
Rob Rix
cfe15a5afa Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	src/Alignment.hs
#	src/Control/Comonad/Cofree.hs
#	src/Data/Adjoined.hs
#	src/Data/Align.hs
#	src/Data/Bifunctor/These.hs
#	src/Data/Coalescent.hs
#	src/Data/Copointed.hs
#	src/Data/Functor/Both.hs
#	src/Data/Option.hs
#	src/Line.hs
#	src/Patch.hs
#	src/Range.hs
#	src/Renderer/JSON.hs
#	src/Renderer/Patch.hs
#	src/Renderer/Split.hs
#	src/SplitDiff.hs
#	stack.yaml
#	test/AlignmentSpec.hs
#	test/CorpusSpec.hs
#	test/Data/Adjoined/Spec.hs
#	test/Data/Functor/Both/Spec.hs
2016-05-26 15:25:45 -04:00
joshvera
ebd5d20171 Remove duplicate imports 2016-05-26 14:04:27 -04:00
joshvera
473ec980b1 Merge remote-tracking branch 'origin/master' into diff-summaries 2016-05-26 13:40:54 -04:00
joshvera
85553f281c Remove duplicate Prologue import 2016-05-26 13:13:30 -04:00
joshvera
ed144bbb1f Fix tests 2016-05-26 13:11:34 -04:00
joshvera
8180b37285 Use Protolude via the Prologue module and add NoImplicitPrelude 2016-05-26 12:58:04 -04:00
Rob Rix
8313074e50 Test that we preserve child lines in the output. 2016-05-26 11:39:24 -04:00
Rob Rix
7854e32c51 Unique the keys on both sides.
This avoids false negatives in the tests where, if we generate two
children with the same key, we appear to drop one of the keys.
2016-05-26 10:16:26 -04:00
Rob Rix
5933a0809d Move branchElementContents into toAlignBranchInputs. 2016-05-26 09:37:06 -04:00
Rob Rix
f48e5c37bc Move alignBranchElement into toAlignBranchInputs. 2016-05-26 09:36:44 -04:00
Rob Rix
6ef8758d7e Add a test case for symmetrical reformatted nodes and context following them. 2016-05-26 09:31:25 -04:00
Rob Rix
3820ab3e66 Filter out bogus empty ranges. 2016-05-25 17:10:38 -04:00
Rob Rix
0025b044f7 Increment the ranges for successive lines. 2016-05-25 17:10:30 -04:00
Rob Rix
b0d154271c Take the actual lines on both sides.
We were getting the wrong ranges.
2016-05-25 17:10:14 -04:00
Rob Rix
5fad7be0f5 🔥 the unused Arbitrary instance over PrettyDiff. 2016-05-25 14:31:47 -04:00
Rob Rix
04e36c4dcb 🔥 alignmentFromBranchElements. 2016-05-25 14:14:38 -04:00
Rob Rix
2ea50d9387 Roll toSourcesAndRanges into toAlignedChildren. 2016-05-25 14:13:27 -04:00
Rob Rix
b4d0749d52 🔥 the top-level bothContents binding. 2016-05-25 13:32:33 -04:00
Rob Rix
eb15740170 Roll toSources into toSourcesAndRanges. 2016-05-25 11:18:49 -04:00
Rob Rix
e5a2c384fc Test that alignBranch covers every line of the input ranges. 2016-05-25 11:13:34 -04:00
Rob Rix
6caf9d3930 Extract alignment from the property test. 2016-05-25 10:59:16 -04:00
Rob Rix
5c1b0809ec Shrink BranchElement by crosswalking. 2016-05-25 10:54:41 -04:00
Rob Rix
5237c7ccc5 Revert "Add a BranchAlignment type."
This reverts commit c85b9fcca08b147c8f2c7bae573f7b30c08f14f4.
2016-05-25 10:43:24 -04:00
Rob Rix
3663cc612b Revert "Add an Arbitrary instance over BranchAlignment."
This reverts commit 17e215b1aec6fdb80212133fe362a9c5120e0b8f.
2016-05-25 10:43:20 -04:00
Rob Rix
e524b4e0fe Revert "Add a Show instance over BranchAlignment."
This reverts commit afd605d4e80d759c8d75b3d912e2e5f36bcc217c.
2016-05-25 10:43:15 -04:00
Rob Rix
d42c071a08 Add a Show instance over BranchAlignment. 2016-05-25 10:42:44 -04:00
Rob Rix
366dba33b3 Add an Arbitrary instance over BranchAlignment. 2016-05-25 10:42:35 -04:00
Rob Rix
03ec660dbc Add a BranchAlignment type. 2016-05-25 10:41:17 -04:00
Rob Rix
13aaee7526 Correct branch element alignment to use crosswalk. 2016-05-25 10:34:22 -04:00
Rob Rix
dbd1030a34 Derive the Show instance for BranchElement. 2016-05-25 10:26:44 -04:00
Rob Rix
1f0d0eb714 Test that alignBranch covers every child in the input. 2016-05-25 09:54:42 -04:00
Rob Rix
c1198065e2 Correct the assignment of ranges to lines. 2016-05-25 09:54:21 -04:00
Rob Rix
6fb9383fb1 Rewrite keysOfAlignedChildren in tacit style in hopes of finding an infinite loop. 2016-05-24 16:21:12 -04:00
Rob Rix
79ef67e6e3 Find the keys of aligned children. 2016-05-24 13:36:12 -04:00
Rob Rix
10a689090b Implement a function to find the key in branch elements that have any. 2016-05-24 13:36:04 -04:00
Rob Rix
a594f54279 Implement construction of arbitrary PrettyDiffs. 2016-05-24 13:04:28 -04:00
Rob Rix
e0e7f0fa4a Add a toPrettyDiff function to abstract the construction of pretty diffs away. 2016-05-24 13:04:10 -04:00
Rob Rix
24a732322c Forgot to commit the import of Control.Monad.State. 2016-05-24 12:00:03 -04:00
joshvera
72dea795d2 Remove literal string from tests 2016-05-23 13:57:04 -04:00
Rob Rix
f3f7b5e6b9 Aligned children contain ranges. 2016-05-21 00:08:01 -04:00
Rob Rix
f720901dbc Compute the aligned children from a list of branch elements. 2016-05-20 23:51:24 -04:00
Rob Rix
e4dd1e7cd8 Compute the sources and ranges in a single step. 2016-05-20 23:49:17 -04:00
Rob Rix
bdb02a4bf4 Compute the ranges for a list of elements. 2016-05-20 23:46:14 -04:00
Rob Rix
db6f2b6430 Arbitrary BranchElements’ contents contain their key, not a fresh key. 2016-05-20 23:19:44 -04:00
Rob Rix
96f94c9bdb Shrink Child contents respecting their prefixes/suffixes. 2016-05-20 23:13:36 -04:00
Rob Rix
ff3691eac4 🔥 showThese. 2016-05-20 23:13:17 -04:00
Rob Rix
9acdb24243 🔥 toSource. 2016-05-20 22:42:46 -04:00
Rob Rix
5d9de67ecc Use the Applicative instance to generate BranchElements. 2016-05-20 22:41:48 -04:00
Rob Rix
ea79ce4f04 Rewrite BranchElement/Source computations correctly. 2016-05-20 22:41:38 -04:00
Rob Rix
61c2bf0ccc Simplify the Show instance for BranchElement. 2016-05-20 22:33:06 -04:00
Rob Rix
111b12846a Arbitrary BranchElements have their contents set appropriately up front. 2016-05-20 22:32:00 -04:00
Rob Rix
bfcd3193da Add a convenience to extract the contents from a branch element. 2016-05-20 22:25:41 -04:00
Rob Rix
26d31fa12a Remove the comments describing the contents of Margin & Child since we no longer guarantee them. 2016-05-20 22:19:35 -04:00
Rob Rix
24af4c4af5 Add a function to align branch elements into their lines. 2016-05-20 22:17:39 -04:00
Rob Rix
30bfae37aa Child, not Child'. 2016-05-20 22:13:36 -04:00
Rob Rix
e1110869e3 🔥 Child. 2016-05-20 22:11:48 -04:00
Rob Rix
2eba6e726e toSource(s)/toChildLists operate over BranchElements. 2016-05-20 22:11:22 -04:00
Rob Rix
ed00a34bee Shrink BranchElements. 2016-05-20 22:08:22 -04:00
Rob Rix
c7ed296e8b Don’t re-quote the contents of branch elements. 2016-05-20 22:04:09 -04:00
Rob Rix
f830256a5c Pretty-print Margin elements. 2016-05-20 22:03:39 -04:00
Rob Rix
f09f9cf3a2 Extract showThese to the top. 2016-05-20 22:03:13 -04:00
Rob Rix
097220a454 Pretty-print Child elements differently. 2016-05-20 22:02:29 -04:00
Rob Rix
919f32a650 Spike out an Arbitrary instance for BranchElement. 2016-05-20 21:59:46 -04:00
Rob Rix
419bcfe776 Add a Show instance over BranchElement. 2016-05-20 21:54:33 -04:00
Rob Rix
3aaa9f79ca Stub in a type representing the elements of branches. 2016-05-20 21:50:52 -04:00
Rob Rix
6eabdd06eb Compute a pair of Sources from a list of child lines. 2016-05-20 21:50:41 -04:00
Rob Rix
048c9d34c2 Add a function to compute lists of children. 2016-05-20 21:50:08 -04:00
Rob Rix
2541405fdc Compute a Source from a list of children. 2016-05-20 21:49:29 -04:00
Rob Rix
aff7fbbc47 Ensure that we do not shrink when both childContents and childMargin are empty. 2016-05-20 16:40:25 -04:00
Rob Rix
0e86c8149a Ensure that we can shrink when either childContents or childMargin is empty. 2016-05-20 16:39:58 -04:00
Rob Rix
21fac60bf1 Shrink contents and margins string-wise but not character-wise.
🎩 @rewinfrey
2016-05-20 16:32:28 -04:00
Rob Rix
bd286bfbce Implement shrink over Child. 2016-05-20 16:29:09 -04:00
Rob Rix
97f6183a55 Destructure the child using RecordWildcards. 2016-05-20 16:13:15 -04:00
Rob Rix
2b65c06ffc Add a Show instance for Child.
🎩 @rewinfrey
2016-05-20 16:07:13 -04:00
Rob Rix
1ae30309b4 Newlines are less common than other padding characters. 2016-05-20 16:06:49 -04:00
Rob Rix
f8e007bb46 Children contain asterisks and newlines. 2016-05-20 15:50:31 -04:00
Rob Rix
b0c0f13b61 Children have a string of contents. 2016-05-20 15:50:15 -04:00
Rob Rix
765ac74532 Generate arbitrary margins of spaces and newlines. 2016-05-20 15:44:47 -04:00
Rob Rix
5efb5d8987 Write the childMargin type as String to silence hlint. 2016-05-20 15:44:24 -04:00
Rob Rix
391b1da75e Arbitrary child keys are alphanumeric. 2016-05-20 15:41:20 -04:00
Rob Rix
f2835ac7a6 Child keys are strings. 2016-05-20 15:40:40 -04:00
Rob Rix
13a90624de Stub in a quick Arbitrary instance for Child. 2016-05-20 15:34:20 -04:00
Rob Rix
72455cdecd Add a datatype to represent children for alignBranch property tests. 2016-05-20 15:34:11 -04:00
Rob Rix
5355143395 Add some pending properties. 2016-05-20 13:05:38 -04:00
Rob Rix
018f289fb5 Abstract PrettyDiff over a type parameter. 2016-05-20 12:39:56 -04:00
Rob Rix
cb2ffd188c Add a test case of ungreedy asymmetrical node alignment. 2016-05-19 16:16:35 -04:00
Rob Rix
2df52eec1d Ditto for the json output. 2016-05-19 14:04:16 -04:00
Rob Rix
172a0aaa47 We no longer extend an expression statement over the end of the line, apparently. 2016-05-19 14:00:22 -04:00
Rob Rix
1d2ec4c5f0 The expected alignment of this case has changed. 2016-05-19 13:54:29 -04:00
Rob Rix
20627f764f Test alignBranch instead of alignChildrenInRanges. 2016-05-19 13:40:10 -04:00
Rob Rix
ac17a13167 Test that context-only lines are paired up before the asymmetrical halves of split-up symmetrical children. 2016-05-19 12:52:51 -04:00
Rob Rix
d25f7ddc7f Test that we align deletions on a line before insertions. 2016-05-19 12:22:48 -04:00
Rob Rix
1979f4e32f Make it convenient to show the raw structures for strange failure cases. 2016-05-19 12:22:33 -04:00
Rob Rix
80f58f01e3 Do some gymnastics to allow our DSL to construct terms/diffs uniformly. 2016-05-19 12:12:11 -04:00
Rob Rix
198304d45d Use the insert/delete constructors in the test fixtures. 2016-05-19 11:10:48 -04:00
Rob Rix
7bc9a358a5 Add PatchConstructible instances to Patch/SplitPatch. 2016-05-19 11:04:19 -04:00
Rob Rix
04ef584b6c Add a typeclass to make patches/split patches. 2016-05-19 11:03:45 -04:00
Rob Rix
3e63b464f7 Test that symmetrical nodes are split if forced by earlier symmetrical nodes. 2016-05-19 09:01:15 -04:00
Rob Rix
c50493175b Remove the redundant tests of asymmetrical nodes preceding/following symmetrical ones. 2016-05-19 00:21:41 -04:00
Rob Rix
24f98f7db9 Test that symmetrical nodes force alignment on both sides. 2016-05-19 00:19:08 -04:00
Rob Rix
17403fc2b2 Fix up the test of symmetrical nodes and following asymmetrical ones. 2016-05-19 00:18:49 -04:00
Rob Rix
b86ce458b0 Test that symmetrical nodes force alignment of later asymmetrical nodes on the same line. 2016-05-19 00:15:03 -04:00
Rob Rix
7d591e737f Test that symmetrical nodes force alignment of earlier asymmetrical nodes on the same line. 2016-05-19 00:13:49 -04:00
Rob Rix
5c2d9b6b01 Change a test name. 2016-05-19 00:13:26 -04:00
Rob Rix
dc8d0d4fdf Add punctuation characters to a test case to clarify the failure. 2016-05-18 17:22:16 -04:00
joshvera
68948287f8 Add a summary renderer 2016-05-18 12:01:16 -04:00
joshvera
aade9415aa Add replacement summaries 2016-05-18 10:24:08 -04:00
joshvera
ab3b8faf32 hey look it works 2016-05-18 10:18:26 -04:00
joshvera
5a8aed6e51 map infos to DifInfos in diffSummary' 2016-05-17 17:34:27 -04:00
joshvera
68f5b0f669 Remove description from diff summary 2016-05-17 15:59:07 -04:00
Rob Rix
7cfdeff5e5 Intersections with empty children have the same shape as the ranges. 2016-05-17 15:04:09 -04:00
joshvera
4d6427a24e Stub some tests 2016-05-17 13:09:14 -04:00
joshvera
927acafcbd add DiffSummarySpec 2016-05-16 14:45:33 -04:00
Rob Rix
e40434f476 Test that we align insertions into empty branches without losing nodes. 2016-05-16 12:37:13 -04:00
Rob Rix
6f819341ab Test that we align insertions which span the entirety of the thing. 2016-05-16 10:54:56 -04:00
Rob Rix
8f05beb023 Spacing for alignment. 2016-05-16 10:41:10 -04:00
Rob Rix
2008b63c17 Compute the maximum value in each element correctly. 2016-05-13 18:44:27 -04:00
Rob Rix
9567c44c57 Guarantee non-empty by prepending. 2016-05-13 18:38:19 -04:00
Rob Rix
c02e6c80a5 Pretty all the diffs. 2016-05-13 18:27:38 -04:00
Rob Rix
a5e11db66d Pull align out to the top level. 2016-05-13 18:25:42 -04:00
Rob Rix
bdd03bb122 For now, children should be aligned at a higher priority than their parents.
This came out of https://github.com/github/semantic-diff/pull/558.
2016-05-13 10:51:52 -04:00
joshvera
170110ee8e Fix up tests 2016-05-04 15:15:25 -04:00
Rob Rix
e70a50720c alignChildrenInRanges always exhausts its inputs, so call it instead. 2016-04-27 17:44:15 -04:00
Rob Rix
679a491ebc Correct the newline-at-eof fixture. 2016-04-27 10:38:02 -04:00
Rob Rix
d7ca3a3eb6 Correct and move the jquery fixture from the todo list to the done list. 2016-04-27 10:33:08 -04:00
Rob Rix
a70ee70b17 Move the no-newline-at-eof JSON fixture to the done list. 2016-04-27 10:30:17 -04:00
Rob Rix
f8dc8f61f9 Correct (I think) the no-newline-at-eof JSON fixture. 2016-04-27 10:26:54 -04:00
Rob Rix
556498e8d2 Move the no-newline-at-eof split fixture to the done list. 2016-04-27 10:12:15 -04:00
Rob Rix
1b5f92bfc8 Correct the no-newline-at-eof split fixture. 2016-04-27 10:11:43 -04:00
Rob Rix
07a55df18b Move the reformat fixture from todo to done 🎉 2016-04-27 10:07:57 -04:00
Rob Rix
9eb7d0f552 Correct the reformatted fixture. 2016-04-27 10:07:03 -04:00
Rob Rix
52970b5bca Terminate with semicolons to work around a parser bug. 2016-04-27 10:06:28 -04:00
Rob Rix
dbfb52776b Remove the newlines from the reformatted fixture. 2016-04-27 10:03:58 -04:00
Rob Rix
9c008f1116 Add a (failing) test that numberedRows produces the correct counts. 2016-04-26 15:44:11 -04:00
Rob Rix
64dd8d93da Add a function to get the counts of numbered rows. 2016-04-26 14:54:24 -04:00
Rob Rix
3ad8fb3b8a Sort the imports. 2016-04-26 14:53:50 -04:00
Rob Rix
28aeb9f4fa Operator section. 2016-04-26 14:20:02 -04:00
Rob Rix
d58123d208 fmap, not liftM. 2016-04-26 14:18:59 -04:00
Rob Rix
5a2925b016 Add an Arbitrary instance over Join These. 2016-04-26 14:17:43 -04:00
Rob Rix
ea8626b9db Shrink These. 2016-04-26 14:17:36 -04:00
Rob Rix
b64a67128c Add an Arbitrary instance over These. 2016-04-26 14:14:31 -04:00
Rob Rix
3366b94b5a Simplify showLine a little further. 2016-04-25 15:08:20 -04:00
Rob Rix
ce9be615a6 Turn the bind around. 2016-04-25 15:04:55 -04:00
Rob Rix
632d2cf86b Simplify padding. 2016-04-25 15:03:49 -04:00
Rob Rix
55af6c2001 Strip newlines inline. 2016-04-25 15:00:46 -04:00
Rob Rix
3a3458684d Derive the Eq instance. 2016-04-25 14:59:20 -04:00
Rob Rix
237558fbed Simplify showLine. 2016-04-25 14:59:00 -04:00
Rob Rix
7628d15a73 Filter newlines out completely. 2016-04-25 14:54:13 -04:00
Rob Rix
ca3ff15a4f Prepend newlines so things line up nicely. 2016-04-25 14:52:24 -04:00
Rob Rix
077dfb8757 Show lines at the minimal width. 2016-04-25 14:51:25 -04:00
Rob Rix
643703821e Use the where clause. 2016-04-25 14:49:47 -04:00
Rob Rix
2bc33b58b8 Concatenate the maybes. 2016-04-25 14:45:07 -04:00
Rob Rix
e9f5c4bc4f Bind the shown lines. 2016-04-25 14:44:26 -04:00
Rob Rix
62f6844038 Map diffs into strings up front. 2016-04-25 14:43:07 -04:00
Rob Rix
f602dc90fe Add a function to convert These -> (,). 2016-04-25 14:14:05 -04:00
Rob Rix
98a7c049b2 Clip when padding. 2016-04-25 14:13:01 -04:00
Rob Rix
bd0d8f0d02 Map the diffs into functions first up. 2016-04-25 14:08:04 -04:00
Rob Rix
dde8612347 Revert "Flip the arguments to showDiff."
This reverts commit 6808da41529f58593553730451185cc90b643ba7.
2016-04-25 14:06:43 -04:00
Rob Rix
a5f45ed699 Flip the arguments to showDiff. 2016-04-25 14:04:57 -04:00
Rob Rix
958dfe914c Pad the first column of These. 2016-04-25 14:02:39 -04:00
Rob Rix
b9b5382b3d Use the pad function for This. 2016-04-25 14:01:45 -04:00
Rob Rix
e214dc3c1d Add a function to pad strings out. 2016-04-25 14:01:39 -04:00
Rob Rix
1fb647ae9d Drop the broken min. 2016-04-25 13:56:57 -04:00
Rob Rix
d9c2bb8e4c Strip newlines in the output diff. 2016-04-25 13:55:39 -04:00
Rob Rix
938b89f8db Add a function to strip newlines from a Functor. 2016-04-25 13:55:33 -04:00
Rob Rix
aa87f65466 Pad out This lines. 2016-04-25 13:47:21 -04:00
Rob Rix
77576905d1 Parameterize showLine by the column width. 2016-04-25 13:38:26 -04:00
Rob Rix
7999f8e540 Wrap the diff in PrettyDiff. 2016-04-25 13:37:19 -04:00
Rob Rix
51191338a6 Add an align binding. 2016-04-25 13:37:07 -04:00
Rob Rix
4d47ebc4b5 Define an Eq instance for PrettyDiff. 2016-04-25 13:00:26 -04:00
Rob Rix
639e1a9443 Add field accessors back in again. 2016-04-25 13:00:18 -04:00
Rob Rix
e481756bd3 Bind the sources in a let. 2016-04-25 12:57:57 -04:00
Rob Rix
3cde6162e7 PrettyDiff takes a pair of Sources. 2016-04-25 12:57:33 -04:00
Rob Rix
a805cad292 Pass the source to showDiff explicitly. 2016-04-25 12:56:03 -04:00
Rob Rix
0ca30921ca Add a Show instance for PrettyDiff. 2016-04-25 12:54:51 -04:00
Rob Rix
0d90744aac PrettyDiff doesn’t declare accessors. 2016-04-25 12:54:40 -04:00
Rob Rix
43359cad9c PrettyDiff carries the Source. 2016-04-25 12:53:15 -04:00
Rob Rix
564dd1d2c7 Stub in a PrettyDiff type. 2016-04-25 12:37:56 -04:00
Rob Rix
f0683932bb 🔥 redundant imports. 2016-04-22 12:56:13 -04:00
Rob Rix
f7fd63528a 🔥 obsolete bindings. 2016-04-22 12:56:09 -04:00
Rob Rix
c6be56f7d3 Disable warnings about orphans.
This is primarily for the benefit of ghc-mod while editing.
2016-04-22 12:54:50 -04:00
Rob Rix
a98876bf18 🔥 a redundant import. 2016-04-22 12:54:26 -04:00
Rob Rix
d2dae5824d Expect children to be in a copointed context. 2016-04-22 12:18:40 -04:00
Rob Rix
ab023c3dcb Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly 2016-04-22 09:33:51 -04:00
joshvera
953c18d693 Add jquery as a submodule for bench 2016-04-21 17:49:50 -04:00
Rob Rix
7a3aac1af9 Add a failing test that we align context following insertions correctly. 2016-04-15 16:10:09 -04:00
Rob Rix
b9230ceac4 Fix the no-newline-at-eof test. 2016-04-14 22:03:50 -04:00
Rob Rix
a61d847705 Replace Data.Bifunctor.These and Data.Align with the these package. 2016-04-14 22:00:00 -04:00
Rob Rix
d99d1d762c 🔥 some redundant imports. 2016-04-14 21:57:52 -04:00
Rob Rix
10de1a72ba 🔥 the Arbitrary instance over Line. 2016-04-14 21:57:33 -04:00
Rob Rix
19ccf9fd54 🔥 some redundant parens. 2016-04-14 21:56:07 -04:00
Rob Rix
6829c6baab 🔥 Data.Adjoined.Spec. 2016-04-14 21:54:25 -04:00
Rob Rix
1972e20233 🔥 Data.Functor.Both.Spec. 2016-04-14 21:54:11 -04:00
Rob Rix
3662b021df Correct the test of insertion patch alignment. 2016-04-14 20:31:03 -04:00
Rob Rix
7c63e92ea7 Construct SplitPatches. 2016-04-14 20:27:24 -04:00
Rob Rix
e5dd029b10 Test that insertions are aligned. 2016-04-14 19:40:36 -04:00
Rob Rix
75bda340ef Sort the Data.Functor.Identity import. 2016-04-14 19:34:59 -04:00
Rob Rix
1c9e5d9087 🔥 tests of splitDiffByLines. 2016-04-14 18:31:03 -04:00
Rob Rix
2564034b6d 🔥 tests of splitAbstractedTerm. 2016-04-14 18:30:52 -04:00
Rob Rix
e3ace6408c Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	test/AlignmentSpec.hs
#	test/PatchOutputSpec.hs
2016-04-14 12:57:45 -04:00
Rob Rix
5991d5b5de Correct the split diff fixture. 2016-04-12 11:23:37 -04:00
Rob Rix
ad47c77509 Correct some test cases. 2016-04-12 05:00:39 -04:00
Rob Rix
1a22eaebf6 Correct the tests. 2016-04-12 04:54:32 -04:00
Rob Rix
0437045089 Simplify the multiple children in a single line test. 2016-04-05 11:37:40 -04:00
Rob Rix
07cf5dac3c Add a (failing) test that multiple children on the same line get aligned. 2016-04-04 18:26:10 -04:00
Rob Rix
d35de99307 🔥 some redundant parens. 2016-04-04 18:25:44 -04:00
Rob Rix
50d18f4472 🔥 a do. 2016-04-04 18:19:58 -04:00
Rob Rix
8b2a9fb6d0 Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	src/Renderer/JSON.hs
#	src/Renderer/Patch.hs
#	test/CorpusSpec.hs
2016-04-04 18:00:25 -04:00
joshvera
928087e1f5 🔥 2016-04-04 17:38:58 -04:00
joshvera
a553709112 Specialize Renderer to Text 2016-04-04 17:20:26 -04:00
Rob Rix
06c4759aed Represent Both as Join (,). 2016-04-04 15:01:47 -04:00
Rob Rix
60d6cfeb90 Use the curried both constructor. 2016-04-04 14:53:09 -04:00
joshvera
ba8fef376a move to where clause 2016-04-02 13:28:17 -04:00
joshvera
4512344e3a update dictionary.json.js 2016-04-01 16:07:05 -04:00
joshvera
4a7004394b fix tests 2016-04-01 15:53:16 -04:00
Rob Rix
f1b2308405 Annotate a leaf type to prevent spew in the REPL. 2016-04-01 10:40:21 -04:00
Rob Rix
63e33f54cc Put the branch/leaf/info DSL at the top level. 2016-04-01 10:15:48 -04:00
Rob Rix
9c706c05e2 🔥 patchWithBoth. 2016-04-01 10:13:37 -04:00
Rob Rix
2540e9d207 🔥 leafWithRangeInSource. 2016-04-01 10:13:33 -04:00
Rob Rix
4f9de16045 Free doesn’t export unfold. 2016-04-01 10:13:22 -04:00
Rob Rix
04fffe584f 🔥 redundant imports. 2016-04-01 10:13:13 -04:00
Rob Rix
dd1355e978 Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly 2016-03-31 18:01:49 -04:00
Rob Rix
da3f04100e Merge branch 'master' into one-header-per-file 2016-03-31 17:00:37 -04:00
joshvera
5ff0d38a2f Make sure we actually show 2 hunks in the test 2016-03-31 13:53:47 -04:00
joshvera
4fafbda1de Test multiple hunks only has one header 2016-03-31 13:20:14 -04:00
joshvera
b44c8fae38 Add jquery alignment test case 2016-03-31 13:11:46 -04:00
Rob Rix
19cc23b51a Merge branch 'master' into cofree-and-bifunctors-sitting-in-a-tree-a-l-i-g-n-edly
# Conflicts:
#	src/Diff.hs
2016-03-30 20:20:50 -04:00
Rob Rix
20bb94bf5e Also, tests. 2016-03-30 17:33:07 -04:00
Rob Rix
ea97b04032 Test that groupChildrenByLine produces asymmetrical context. 2016-03-24 13:56:07 -04:00
Rob Rix
04ca818b0b Rename the test. 2016-03-24 13:54:11 -04:00
Rob Rix
931ba9808f Test that groupChildrenByLine produces symmetrical context. 2016-03-24 13:53:58 -04:00
Rob Rix
07bc16bf35 Be more specific with the test names. 2016-03-24 13:44:57 -04:00
Rob Rix
899d53eec2 Test the alignment of identical nodes across multiple lines. 2016-03-24 13:05:52 -04:00
Rob Rix
fbbf80a3fa Test the alignment of identical nodes on a single line. 2016-03-24 13:05:44 -04:00
Rob Rix
2e9eb92609 Rename the tests. 2016-03-22 09:20:44 -04:00
Rob Rix
1a3a32e3e1 Correct the test fixtures. 2016-03-22 00:17:20 -04:00
Rob Rix
2226acf61c Revert "Add a convenience to construct Source Char."
This reverts commit 63e023e439491207aa739bb0e68660770eaa9272.
2016-03-21 19:08:35 -04:00
Rob Rix
7ff808f3dc Add some tests (which won’t typecheck yet). 2016-03-21 19:08:02 -04:00
Rob Rix
62ac37c981 Add a convenience to construct branch diffs. 2016-03-21 18:54:34 -04:00
Rob Rix
361bfc0e81 Add a convenience to construct leaf diffs. 2016-03-21 18:54:27 -04:00
Rob Rix
1f1be15a99 Add a convenience to construct Source Char. 2016-03-21 18:54:18 -04:00
Rob Rix
d3a3b68752 Add a convenience to construct Info. 2016-03-21 18:54:09 -04:00
joshvera
2d711d2a56 just one slash 2016-03-16 18:56:57 -04:00
Rob Rix
6b2b2a811b Move the nested insert tests to the todo pile. 2016-03-15 15:53:04 -04:00
Rob Rix
8e07d40a0d Disable the Monoid tests over Both Line Char. 2016-03-15 15:52:54 -04:00
Rob Rix
7da4a180b7 Shrink Adjoined. 2016-03-15 11:46:15 -04:00
Rob Rix
493f55aa65 Shrink Both. 2016-03-15 11:46:09 -04:00
Rob Rix
943e0b7a40 Shrink Lines. 2016-03-15 11:46:05 -04:00