Closed zakuro9715 closed 3 years ago
I can not reproduce that with latest V 0.1.30 7426544 .
Please provide more details about your environment (the output of v doctor
).
For me:
0[10:25:02]delian@nemesis: /v/pv $ ./v fmt -diff vlib/time/parse_test.v
--- /v/pv/vlib/time/parse_test.v 2020-12-16 10:22:00.927875096 +0200
+++ /tmp/vfmt_01ESNAE6BGDAWVQFX1ENRTS817_parse_test.v 2020-12-16 10:25:04.623408937 +0200
@@ -63,5 +63,5 @@ fn test_parse_iso8601() {
'2020-06-05T15:38:06.015959+02:00',
'2020-06-05T15:38:06.015959-02:00',
- '2020-11-05T15:38:06.015959Z'
+ '2020-11-05T15:38:06.015959Z',
]
times := [
0[10:25:04]delian@nemesis: /v/pv $ ./v fmt -w vlib/time/parse_test.v
Reformatted file: /v/pv/vlib/time/parse_test.v
0[10:25:09]delian@nemesis: /v/pv $ git diff
diff --git a/vlib/time/parse_test.v b/vlib/time/parse_test.v
index 9cb580f6d..04fa612b3 100644
--- a/vlib/time/parse_test.v
+++ b/vlib/time/parse_test.v
@@ -62,7 +62,7 @@ fn test_parse_iso8601() {
'2020-06-05T15:38:06.015959+00:00',
'2020-06-05T15:38:06.015959+02:00',
'2020-06-05T15:38:06.015959-02:00',
- '2020-11-05T15:38:06.015959Z'
+ '2020-11-05T15:38:06.015959Z',
]
times := [
[2020, 6, 5, 15, 38, 6, 0],
0[10:25:12]delian@nemesis: /v/pv $ ./v -stats vlib/time/parse_test.v
checker summary: 0 V errors, 0 V warnings
compilation took: 221 ms
running tests in: vlib/time/parse_test.v
OK [1/7] 0.055 ms 2 asserts | main.test_parse()
OK [2/7] 0.004 ms 1 assert | main.test_parse_invalid()
OK [3/7] 0.032 ms 4 asserts | main.test_parse_rfc2822()
OK [4/7] 0.009 ms 1 assert | main.test_parse_rfc2822_invalid()
OK [5/7] 0.054 ms 42 asserts | main.test_parse_iso8601()
OK [6/7] 0.008 ms 7 asserts | main.test_parse_iso8601_local()
OK [7/7] 0.009 ms 8 asserts | main.test_parse_iso8601_invalid()
0.317 ms <=== total time spent running V tests in "parse_test.v"
ok, fail, skip, total = 65, 0, 0, 65
0[10:25:24]delian@nemesis: /v/pv $
The whole of time
and os
is now checked with v test-cleancode
,
so it should be invariant under v fmt -w
runs.
Sorry. I forgot re compile head. After v self, it works
V version: OS:
What did you do?
cat vlib/time/parse_test.v
v fmt -w vlib/time/parse_test.v
What did you expect to see?
Don't break code
What did you see instead?
git diff