@@ -50,71 +50,6 @@ func! Test_goimports() abort
50
50
call assert_equal (expected, actual)
51
51
endfunc
52
52
53
- func ! Test_run_fmt_gopls () abort
54
- try
55
- let g: go_fmt_command = ' gopls'
56
-
57
- let actual_file = tempname ()
58
- call writefile (readfile (" test-fixtures/fmt/hello.go" ), actual_file)
59
-
60
- let expected = join (readfile (" test-fixtures/fmt/hello_golden.go" ), " \n " )
61
-
62
- " run our code
63
- call go#fmt#run (" gofmt" , actual_file, " test-fixtures/fmt/hello.go" )
64
-
65
- " this should now contain the formatted code
66
- let actual = join (readfile (actual_file), " \n " )
67
-
68
- call assert_equal (expected, actual)
69
- finally
70
- unlet g: go_fmt_command
71
- endtry
72
- endfunc
73
-
74
- func ! Test_update_file_gopls () abort
75
- try
76
- let g: go_fmt_command = ' gopls'
77
-
78
- let expected = join (readfile (" test-fixtures/fmt/hello_golden.go" ), " \n " )
79
- let source_file = tempname ()
80
- call writefile (readfile (" test-fixtures/fmt/hello_golden.go" ), source_file)
81
-
82
- let target_file = tempname ()
83
- call writefile ([" " ], target_file)
84
-
85
- " update_file now
86
- call go#fmt#update_file (source_file, target_file)
87
-
88
- " this should now contain the formatted code
89
- let actual = join (readfile (target_file), " \n " )
90
-
91
- call assert_equal (expected, actual)
92
- finally
93
- unlet g: go_fmt_command
94
- endtry
95
- endfunc
96
-
97
- func ! Test_goimports_gopls () abort
98
- try
99
- let g: go_fmt_command = ' gopls'
100
-
101
- let $GOPATH = ' test-fixtures/fmt/'
102
- let actual_file = tempname ()
103
- call writefile (readfile (" test-fixtures/fmt/src/imports/goimports.go" ), actual_file)
104
-
105
- let expected = join (readfile (" test-fixtures/fmt/src/imports/goimports_golden.go" ), " \n " )
106
-
107
- " run our code
108
- call go#fmt#run (" goimports" , actual_file, " test-fixtures/fmt/src/imports/goimports.go" )
109
-
110
- " this should now contain the formatted code
111
- let actual = join (readfile (actual_file), " \n " )
112
-
113
- call assert_equal (expected, actual)
114
- finally
115
- unlet g: go_fmt_command
116
- endtry
117
- endfunc
118
53
" restore Vi compatibility settings
119
54
let &cpo = s: cpo_save
120
55
unlet s: cpo_save
0 commit comments