From ac1bddb7ca2f3b497085b06f310280f7d7ec0fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 23 Jun 2021 16:22:13 +0800 Subject: fix #571 --- test/type_inference/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 7d5ea44f..3ca46cda 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2,6 +2,7 @@ local files = require 'files' local vm = require 'vm' local guide = require 'parser.guide' local infer = require 'core.infer' +local config = require 'config' rawset(_G, 'TEST', true) @@ -746,3 +747,23 @@ return test TEST 'function' [[ string.gsub():gsub():() ]] + +config.config.hover.enumsLimit = 5 +TEST 'a|b|c|d|e...(+5)' [[ +---@type 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j' +local +]] + +config.config.hover.enumsLimit = 1 +TEST 'a...(+9)' [[ +---@type 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j' +local +]] + +config.config.hover.enumsLimit = 0 +TEST '...(+10)' [[ +---@type 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j' +local +]] + +config.config.hover.enumsLimit = 5 -- cgit v1.2.3