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

308 Commits

Author SHA1 Message Date
Rob Rix
757fa00b03
Indentation. 2019-10-08 16:30:56 -04:00
Patrick Thomson
3b4b9dc95e fix stray typo and remove spec invocations 2019-10-08 15:02:33 -04:00
Patrick Thomson
a1b50b1f51 Convert Numeric.Spec to use Hedgehog. 2019-09-25 17:09:23 -04:00
Patrick Thomson
a2a757c9f5 Convert Data.Semigroup.App.Spec to use Hedgehog. 2019-09-25 16:59:27 -04:00
Rob Rix
2ce8b515b6
🔥 Data.Source.Spec. 2019-09-20 16:11:54 -04:00
Rob Rix
1d5e15010f
Switch everything over to using Source.Range. 2019-09-20 14:28:25 -04:00
Patrick Thomson
312cbcc269
Merge branch 'master' into property-test-scientific-parser 2019-09-03 13:46:06 -04:00
Timothy Clem
5763cfdfb6 Use tasty for testing instead 2019-08-19 10:34:55 -07:00
Timothy Clem
0aab5ebd55 Replace supportedExts 2019-08-15 15:48:17 -07:00
Patrick Thomson
f9aa9923b7 Port hspec tests to tasty-hunit and institute simple property test. 2019-08-07 11:26:54 -04:00
Patrick Thomson
b17a2c0ee8 Better nomenclature. 2019-06-19 17:56:37 -04:00
Patrick Thomson
4de36c5f0e Rewrite the Stat tests so they're not racy. 2019-06-19 17:54:53 -04:00
Patrick Thomson
43e3fb4533 Remove unnecessary use of parallel. 2019-06-19 17:22:09 -04:00
Jan Hrček
ec4248cbb4 Fix warnings in tests
27 [-Wunused-matches]
 7 [-Wmissing-export-lists]
 6 [-Wunused-imports]
 5 [-Wmissing-signatures]
 2 [-Wincomplete-uni-patterns]
 1 [-Wunused-top-binds]
 1 [-Wtype-defaults]
2019-06-15 08:56:59 +02:00
Patrick Thomson
e1d94f07d1 Remove Listable instance for Source.
This was created with a whole mess of Leancheck combinators. A
Hedgehog approach makes things easier.
2019-06-14 11:53:42 -04:00
Patrick Thomson
bfdb4a1de7 Clean up specs with some implicit parameters.
Test cases are a good use of `-XImplicitParams`, because often one
finds oneself plumbing a bunch of parameters obtained from IO through
a dozen layers of pure functions. Implicit parameters make this sort
of passing significantly easier.

Fixes #128.
2019-06-12 13:55:14 -04:00
Patrick Thomson
7d88f930cb Fix sentence fragment. 2019-06-12 13:27:34 -04:00
Patrick Thomson
6a15695195 Even more unused imports. 2019-06-12 13:16:34 -04:00
Patrick Thomson
acbacbe779 Use golden tests for the CLI. 2019-06-12 12:26:37 -04:00
Patrick Thomson
99c4bb21f8 Overhaul test harnesses and add tasty bounds. 2019-06-12 11:30:20 -04:00
Max Brunsfeld
3c0dd6cc45 Add unit test for parsing with a timeout
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2019-03-19 11:56:07 -07:00
Rick Winfrey
9813ae2319 Parameterize TaskSession with isPublic 2019-02-15 16:22:51 -08:00
Timothy Clem
50bedeb689 Remove extraneous proto encoding/decode from our internal datatypes 2019-02-06 14:55:43 -08:00
Timothy Clem
ce04fa8f12 Refactor runTask 2019-02-01 15:04:23 -08:00
Rick Winfrey
e7c984182c Update specs 2019-01-18 18:21:24 -08:00
Patrick Thomson
e329cbe89a unify the last spec 2018-12-11 17:36:42 -05:00
Patrick Thomson
1de0e9ef09 move specs around 2018-12-11 17:21:39 -05:00
joshvera
073dca372d Remove Data.Abstract.Environment 2018-12-05 10:20:35 -05:00
Timothy Clem
343289f1c5 Merge remote-tracking branch 'origin/master' into docstrings-round2 2018-11-06 09:17:49 -08:00
Patrick Thomson
7ea52dbfe3 Give Control.Matching API better ergonomics.
Given that @tclem and I have found the matcher API frustrating, I've
taken a stab at improving its ergonomics, and I've found some success
in separating composition of matchers from predicate-based narrowing
thereof.

The biggest change here is the elimination of the old `match`
combinator, which proved to be clumsy in that it complected narrowing
and composition. Top-down matching combinators are now written with
the `need` combinator and the `>>>` combinator, which is more readable
and more versatile. Here's a matcher that accepts functions with
Python docstrings:

```haskell
docstringMatcher :: ( Decl.Function :< fs
                    , [] :< fs
                    , Lit.TextElement :< fs
                    , term ~ Term (Sum fs) ann
                    ) => Matcher term term
docstringMatcher = target <*
               (need Decl.functionBody
                >>> narrow @[]
                >>> mhead
                >>> narrow @Lit.TextElement
                >>> ensure Lit.isTripleQuoted))
```

Pretty readable, right? Each step of the tree regular expression -
choosing function bodies, ensuring said bodies are lists, examining
the first element, and choosing only TextElements containing
triple-quoted strings - is made implicit. The old way would have
looked something like this:

```haskell
docstringMatcher = target <* match Decl.functionBody
                           $ narrow
                           $ matchM listToMaybe
                           $ target <* ensure Lit.isTripleQuoted
```
which is a good deal more disorganized and less flexible
in the quite-common case of applying functions during a
matching pass. Separating the act of composition from
function application is a big win here.

Further comments are inline.
2018-11-02 19:25:29 -04:00
Timothy Clem
0f56f33f24 Introduce some symbol/tags tests 2018-11-02 13:55:30 -07:00
Patrick Thomson
b9cf8f73c6 Environment and App. 2018-10-31 15:47:30 -04:00
Patrick Thomson
d473b9e1af add Data/Abstract/Name/Spec 2018-10-31 13:19:43 -04:00
Patrick Thomson
b0e6190dbf add Data/Range/Spec 2018-10-31 12:46:52 -04:00
Patrick Thomson
cd05aaa7a5 add Data/Graph/Spec 2018-10-31 12:30:56 -04:00
Patrick Thomson
d1cc400dc0 add spec file 2018-09-14 13:10:22 -04:00
Patrick Thomson
dccea555ed Extremely ad-hoc renderer to Docs 2018-07-31 12:44:20 -04:00
Patrick Thomson
6823fb92b6 better module name 2018-07-31 10:43:46 -04:00
Patrick Thomson
a61fe301c4 Skeleton and initial test case 2018-07-30 16:00:09 -04:00
Patrick Thomson
0ed48c7bbe Simplest test possible. 2018-07-16 11:07:40 -04:00
Rob Rix
7e2f7614f7 Fix up the imports. 2018-07-10 14:17:56 -04:00
Rob Rix
1e6a3f71e2 Use withOptions in the spec. 2018-07-10 14:16:51 -04:00
Rob Rix
40d46e921d Pass the configuration to the analysis specs. 2018-07-10 14:09:22 -04:00
Rob Rix
255a0aa62b Move TaskConfig into Semantic.Util. 2018-07-10 14:09:02 -04:00
Rob Rix
b33daf0ce1 Pass the task config stuff around as a single datum. 2018-07-10 13:49:34 -04:00
Rob Rix
90cb86d027 Pass config & queues to the integration specs. 2018-07-09 14:26:15 -04:00
Patrick Thomson
f9f0dd5e79 Use a hand-written integer parser.
Rather than relying on the `Read` instance for `Integer`, let's make
our assumptions about the format explicit. This was mostly a matter of
extracting internal functions from the `Scientific` parser.
2018-06-25 11:55:32 -04:00
Patrick Thomson
fbff61b247 actually run the specs 2018-06-05 12:51:23 -04:00
Rob Rix
54150552b3 Merge branch 'master' into 🔥-galign 2018-05-29 08:53:37 -04:00
Rob Rix
c427be3670 Stub in a spec for Evaluator. 2018-05-07 14:21:05 -04:00