Qi Xiao
fd81492236
Fix tests that leave behind test directories on Windows.
2019-03-18 22:25:24 +00:00
Qi Xiao
d262a8c61c
Fix test on Windows (for real).
2018-12-17 23:13:32 +00:00
Qi Xiao
53feefe839
util: Remove unused function InTempDir.
2018-11-19 20:50:52 +00:00
Qi Xiao
e57c037ca7
golint fixes.
2018-10-13 17:52:54 +01:00
Qi Xiao
24e0449318
s/Pprint/PPrint/ everywhere.
2018-10-13 16:51:00 +01:00
Qi Xiao
1c133f6979
util: Change the API of WithTempDir and InTempDir.
...
They have been renamed to TestDir and InTestDir, and instead of taking a
callback, they return a cleanup function. This saves one level of
indentation in the caller.
2018-10-13 14:04:13 +01:00
Qi Xiao
cee01232ec
Move eval/vals.Feed to util, and add a test.
2018-10-11 00:25:24 +08:00
Qi Xiao
fb80862ec4
Add a new package diag for diagnostic utils.
2018-10-11 00:20:32 +08:00
Qi Xiao
103aabc518
util: Add a Complain and Complainf function.
2018-10-08 19:05:40 +08:00
Qi Xiao
7969c6650f
eval: Remove more throws.
...
This addresses #570 .
2018-03-01 10:13:00 -05:00
Qi Xiao
35d39961c2
eval: Add a stackTrace type.
2018-02-28 20:22:46 -05:00
Qi Xiao
ceffc629c4
util: Errors now flatten its arguments.
2018-01-21 11:16:40 +00:00
Qi Xiao
61bf413954
Cosmetics.
2018-01-01 15:12:34 +00:00
Qi Xiao
3db78def10
util: In WithTempDirs, eval symlinks of temp dirs.
2017-12-22 22:59:58 +00:00
Qi Xiao
e0ee3f1a07
util: Moar tests.
2017-12-19 02:16:49 +00:00
Qi Xiao
85ba184b5a
util: Test SourceRange.
2017-12-19 02:02:39 +00:00
Qi Xiao
e4ac01ef47
util: Make linter happy.
2017-12-19 01:37:52 +00:00
Qi Xiao
ac824942b7
eval: Print compactly when Exception has a single traceback.
...
This supersedes #487 .
2017-12-19 01:14:27 +00:00
Qi Xiao
3a6d84c402
util: Make SourceRange.Pprint return string, not take Writer.
2017-12-19 01:14:26 +00:00
Qi Xiao
35929aa9b9
util: SourceContext -> SourceRange.
2017-12-19 01:14:26 +00:00
Qi Xiao
de3f45e28e
util: Break (*SourceContext).Pprint into multiple stages.
2017-12-19 01:14:26 +00:00
Qi Xiao
ca8307f414
Deadcode removal.
2017-12-18 01:46:06 +00:00
Qi Xiao
f30a2b6837
Fix test against tilde-abbr on Windows.
2017-12-17 05:52:55 +00:00
Qi Xiao
914da1e010
util: Add WithTempDirs; add test against tempdir.go and fix a bug.
2017-12-17 04:16:12 +00:00
Qi Xiao
6d3e56b4a1
edit: Move more setup into edit/tty.Setup.
...
The utility of concatenating multiple errors has changed slightly.
2017-12-17 02:59:04 +00:00
Qi Xiao
81617e8ef2
Fix minor issues found by gofmt, go vet, and misspell.
2017-12-14 01:28:07 +00:00
Qi Xiao
457e2e7626
util: Make test pass on Windows.
2017-12-08 00:52:21 +00:00
Qi Xiao
c44e2d7321
Use build tags in a more compact way.
2017-12-08 00:45:10 +00:00
Qi Xiao
a490b57911
util: Add ClaimFile, a utility for getting log file.
2017-12-07 02:00:18 +00:00
Qi Xiao
a4c4c75aec
util: Export SetOutput; clarify condition for closing old output.
2017-12-07 02:00:18 +00:00
Qi Xiao
fab99616fb
util: Append, not truncate, log files.
2017-12-06 23:16:03 +00:00
Qi Xiao
d677f88a09
Fix test on Unix.
2017-12-06 17:59:55 +01:00
Qi Xiao
b74b4ab87e
sys/ and util/: Fix test cases on Windows.
2017-12-05 23:20:12 +00:00
Qi Xiao
9fe0250955
Use os/exec.LookPath to fix external command search on Windows.
2017-12-05 00:48:38 +01:00
Tw
2a579f0d0c
use proper print in pprinter
...
Signed-off-by: Tw <tw19881113@gmail.com>
2017-11-23 10:28:56 +01:00
Qi Xiao
41018bd1ab
util: Thrown.Error -> .Wrapped; implement Error()
2017-09-29 22:14:55 +08:00
Qi Xiao
e57f018199
util: Fix signature of ThrowsAny.
2017-09-29 22:03:54 +08:00
Qi Xiao
bfbf6ca757
util: Add ThrowsAny, along with test cases.
2017-09-29 22:02:44 +08:00
Qi Xiao
02db4f012c
util: Add WithTempDir.
2017-09-21 00:10:03 +01:00
Qi Xiao
4f572d0095
Add util.PprintError.
2017-07-14 00:06:37 +01:00
Qi Xiao
ec8aca54f5
Enhance ScanIntoOpts, and rename to ScanOptsToStruct.
2017-07-13 22:29:28 +01:00
Qi Xiao
e99031f3e2
Use understore in filenames.
2017-06-26 19:47:10 +02:00
Qi Xiao
830b7fe9c9
Experimental support for subseq matcher in compl mode.
2017-05-24 01:25:10 +01:00
Qi Xiao
4a8d3adaad
util: Fix getwd_test.go.
2017-05-23 17:30:55 +01:00
Qi Xiao
7727601313
Add a helper function for testing in a tempdir.
2017-05-23 05:40:49 +01:00
Qi Xiao
3d001ead25
In tests that chdir, remember to go back.
2017-05-23 05:27:48 +01:00
Qi Xiao
45a0f1e1ad
util: Add helpers for testing throws.
2017-05-21 02:08:18 +01:00
Qi Xiao
16bc9c5a81
util.AllExecutables -> EachExecutable; callback instead of channel.
2017-02-09 15:57:16 -08:00
Qi Xiao
571e0879d0
Make util.Pprinter take an indent string.
2017-01-29 18:20:35 +00:00
Qi Xiao
ddbbfb9d33
Clean up exception representation.
...
Exceptions are now already represented by eval.Exception, which consist of an
error and a traceback. eval.Error is dropped.
2017-01-29 02:30:04 +00:00