Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
101 lines
5.4 KiB
VimL
101 lines
5.4 KiB
VimL
source autoload/javacomplete/util.vim
|
|
source t/javacomplete.vim
|
|
|
|
call vspec#hint({'sid': 'g:SID("util")'})
|
|
|
|
|
|
describe 'javacomplete utils test'
|
|
it 'CountDims test'
|
|
Expect Call('javacomplete#util#CountDims', '') == 0
|
|
Expect Call('javacomplete#util#CountDims', 'String[]') == 1
|
|
Expect Call('javacomplete#util#CountDims', 'String[][]') == 2
|
|
Expect Call('javacomplete#util#CountDims', 'String[][][][][]') == 5
|
|
Expect Call('javacomplete#util#CountDims', 'String]') == 1
|
|
Expect Call('javacomplete#util#CountDims', 'String[') == 0
|
|
Expect Call('javacomplete#util#CountDims', 'String[[') == 0
|
|
Expect Call('javacomplete#util#CountDims', 'String]]') == 1
|
|
end
|
|
|
|
it 'GetClassNameWithScope test'
|
|
new
|
|
put ='ArrayLi'
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'ArrayLi'
|
|
|
|
new
|
|
put ='ArrayList '
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'ArrayList'
|
|
|
|
new
|
|
put ='ArrayList l'
|
|
call cursor(0, 10)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'ArrayList'
|
|
|
|
new
|
|
call cursor(1, 1)
|
|
put! ='ArrayList<String> l'
|
|
call cursor(1, 11)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'String'
|
|
|
|
new
|
|
call cursor(1, 1)
|
|
put! ='List l = new ArrayList<String>()'
|
|
call cursor(1, 1)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'List'
|
|
call cursor(1, 14)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'ArrayList'
|
|
call cursor(1, 31)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == ''
|
|
|
|
new
|
|
call cursor(1, 1)
|
|
put! ='@Annotation'
|
|
call cursor(1, 2)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == '@Annotation'
|
|
|
|
new
|
|
call cursor(1, 1)
|
|
put! ='ArrayList. '
|
|
call cursor(1, 12)
|
|
Expect Call('javacomplete#util#GetClassNameWithScope') == 'ArrayList'
|
|
|
|
end
|
|
|
|
it 'CleanFQN test'
|
|
Expect Call('javacomplete#util#CleanFQN', '') == ''
|
|
Expect Call('javacomplete#util#CleanFQN', 'java.lang.Object') == 'Object'
|
|
Expect Call('javacomplete#util#CleanFQN', 'java.lang.Object java.util.HashMap.get()') == 'Object get()'
|
|
Expect Call('javacomplete#util#CleanFQN', 'public java.math.BigDecimal java.util.HashMap.computeIfAbsent(java.lang.String,java.util.function.Function<? super java.lang.String, ? extends java.math.BigDecimal>)') == 'public BigDecimal computeIfAbsent(String,Function<? super String, ? extends BigDecimal>)'
|
|
|
|
Expect Call('javacomplete#util#CleanFQN', 'public boolean scala.Tuple2.specInstance$()') == 'public boolean specInstance$()'
|
|
end
|
|
|
|
it 'Prune test'
|
|
Expect Call('javacomplete#util#Prune', ' sb. /* block comment*/ append( "stringliteral" ) // comment ') == 'sb. append( "" ) '
|
|
Expect Call('javacomplete#util#Prune', ' list.stream(\n\t\ts -> {System.out.println(s)}).') == 'list.stream(\n\t\ts -> {System.out.println(s)}). '
|
|
end
|
|
|
|
it 'HasKeyword test'
|
|
Expect Call('javacomplete#util#HasKeyword', 'java.util.function.ToIntFunction') == 0
|
|
end
|
|
|
|
it 'GenMethodParamsDeclaration test'
|
|
let m = {'p': ['int', 'int'], 'r': 'java.util.List<java.lang.Object>', 'c': 'java.util.List<java.lang.Object>', 'd': 'public abstract java.util.List<java.lang.Object> java.util.List.subList(int,int)', 'm': '10000000001', 'n': 'subList'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract java.util.List<java.lang.Object> java.util.List.subList(int i1, int i2)'
|
|
|
|
let m = {'p': ['java.lang.Object'], 'r': 'int', 'c': 'int', 'd': 'public abstract int java.util.List.indexOf(java.lang.Object)', 'm': '10000000001', 'n': 'indexOf'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract int java.util.List.indexOf(Object object)'
|
|
|
|
let m = {'p': ['java.util.Collection<? extends java.lang.Object>'], 'r': 'boolean', 'c': 'boolean', 'd': 'public abstract boolean java.util.List.addAll(java.util.Collection<? extends java.lang.Object>)', 'm': '10000000001', 'n': 'addAll'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract boolean java.util.List.addAll(Collection<? extends Object> collection)'
|
|
|
|
let m = {'p': ['T[]'], 'r': 'T[]', 'c': 'T[]', 'd': 'public abstract <T> T[] java.util.List.toArray(T[])', 'm': '10000000001', 'n': 'toArray'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract <T> T[] java.util.List.toArray(T[] t)'
|
|
|
|
let m = {'p': ['java.math.BigDecimal', 'java.math.BigDecimal'], 'r': 'int', 'c': 'int', 'd': 'public abstract int indexOf(java.math.BigDecimal,java.math.BigDecimal)', 'm': '10000000001', 'n': 'indexOf'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract int indexOf(BigDecimal bigDecimal1, BigDecimal bigDecimal2)'
|
|
|
|
let m = {'p': ['java.math.BigDecimal', 'java.math.BigDecimal'], 'r': 'int', 'c': 'int', 'd': 'public abstract int indexOf(java.math.BigDecimal,java.math.BigDecimal) throws java.lang.Exception', 'm': '10000000001', 'n': 'indexOf'}
|
|
Expect Call('javacomplete#util#GenMethodParamsDeclaration', m) == 'public abstract int indexOf(BigDecimal bigDecimal1, BigDecimal bigDecimal2) throws java.lang.Exception'
|
|
end
|
|
end
|