Mercurial > vim
comparison src/testdir/test_json.vim @ 9618:81ba6e4eb72b v7.4.2086
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 21 20:33:32 2016 +0200
patch 7.4.2086
Problem: Using the system default encoding makes tests unpredictable.
Solution: Always use utf-8 or latin1 in the new style tests. Remove setting
encoding and scriptencoding where it is not needed.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 21 Jul 2016 20:45:06 +0200 |
parents | bec1dcfaa8be |
children | f83b6a0b6148 |
comparison
equal
deleted
inserted
replaced
9617:3682c229ac32 | 9618:81ba6e4eb72b |
---|---|
1 " Test for JSON functions. | 1 " Test for JSON functions. |
2 | 2 |
3 " JSON requires using utf-8. Conversion breaks the asserts, therefore set | 3 " JSON requires using utf-8, because conversion breaks the asserts. |
4 " 'encoding' to utf-8. | |
5 if !has('multi_byte') | 4 if !has('multi_byte') |
6 finish | 5 finish |
7 endif | 6 endif |
8 set encoding=utf-8 | |
9 scriptencoding utf-8 | |
10 | 7 |
11 let s:json1 = '"str\"in\\g"' | 8 let s:json1 = '"str\"in\\g"' |
12 let s:var1 = "str\"in\\g" | 9 let s:var1 = "str\"in\\g" |
13 let s:json2 = '"\u0001\u0002\u0003\u0004\u0005\u0006\u0007"' | 10 let s:json2 = '"\u0001\u0002\u0003\u0004\u0005\u0006\u0007"' |
14 let s:var2 = "\x01\x02\x03\x04\x05\x06\x07" | 11 let s:var2 = "\x01\x02\x03\x04\x05\x06\x07" |