File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
autoload/vital/__vital__/Web Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ function! s:_tempname() abort
176176endfunction
177177
178178function ! s: _file_resolve (file ) abort
179- return fnamemodify (a: file , ' :gs?\\?/?' )
179+ return fnamemodify (a: file , ' :p: gs?\\?/?' )
180180endfunction
181181
182182function ! s: _postdata (data) abort
Original file line number Diff line number Diff line change @@ -52,4 +52,33 @@ Describe Web.HTTP
5252 endfor
5353 End
5454 End
55+
56+ Describe .request()
57+ It client curl
58+ let current_dir = fnamemodify(getcwd(), ":gs?\\?/?")
59+ let response = HTTP.request({
60+ \ 'url': 'file:///' .. current_dir .. '/test/_testdata/Web/test.html',
61+ \ 'client': ['curl'],
62+ \ })
63+
64+ Assert Equals(response.content, "テスト\n")
65+ End
66+
67+ It option_outputFile
68+ let current_dir = fnamemodify(getcwd(), ":gs?\\?/?")
69+ let output_file = tempname()
70+ let response = HTTP.request({
71+ \ 'url': 'file:///' .. current_dir .. '/test/_testdata/Web/test.html',
72+ \ 'outputFile': output_file,
73+ \ 'client': ['curl'],
74+ \ })
75+
76+ let output_file_content = readfile(output_file)
77+
78+ Assert Equals(len(output_file_content), 1)
79+ Assert Equals(output_file_content[0], "テスト")
80+
81+ call delete(output_file)
82+ End
83+ End
5584End
Original file line number Diff line number Diff line change 1+ テスト
You can’t perform that action at this time.
0 commit comments