Mercurial > vim
comparison src/testdir/test87.in @ 4851:96e154e825a7 v7.3.1172
updated for version 7.3.1172
Problem: Python 2: loading modules doesn't work well.
Solution: Fix the code. Add more tests. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 12 Jun 2013 14:20:36 +0200 |
parents | d59ff2114733 |
children | 4ed713442c51 |
comparison
equal
deleted
inserted
replaced
4850:6c1f3a6714bd | 4851:96e154e825a7 |
---|---|
1 Tests for various python features. vim: set ft=vim : | 1 Tests for various python features. vim: set ft=vim : |
2 | 2 |
3 STARTTEST | 3 STARTTEST |
4 :so small.vim | 4 :so small.vim |
5 :set noswapfile | |
5 :if !has('python3') | e! test.ok | wq! test.out | endif | 6 :if !has('python3') | e! test.ok | wq! test.out | endif |
6 :lang C | 7 :lang C |
7 :py3 import vim | 8 :py3 import vim |
8 :fun Test() | 9 :fun Test() |
9 :let l = [] | 10 :let l = [] |
1036 ee('vim.current.xxx = True') | 1037 ee('vim.current.xxx = True') |
1037 EOF | 1038 EOF |
1038 :" | 1039 :" |
1039 :" Test import | 1040 :" Test import |
1040 py3 << EOF | 1041 py3 << EOF |
1042 sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) | |
1043 sys.path.append(os.path.join(os.getcwd(), 'python_after')) | |
1041 vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') | 1044 vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') |
1042 from module import dir as d | 1045 from module import dir as d |
1043 from modulex import ddir | 1046 from modulex import ddir |
1044 cb.append(d + ',' + ddir) | 1047 cb.append(d + ',' + ddir) |
1048 import before | |
1049 cb.append(before.dir) | |
1050 import after | |
1051 cb.append(after.dir) | |
1045 EOF | 1052 EOF |
1046 :" | 1053 :" |
1047 :" Test exceptions | 1054 :" Test exceptions |
1048 :fun Exe(e) | 1055 :fun Exe(e) |
1049 : execute a:e | 1056 : execute a:e |