From 2d5b2cbfa492e80841d4e8822106434f7ee4f303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 28 Dec 2020 16:50:24 +0800 Subject: add `vm.getDefFields` --- test/full/init.lua | 1 + test/full/self.lua | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/full/self.lua (limited to 'test') diff --git a/test/full/init.lua b/test/full/init.lua index f370671e..ad34da7d 100644 --- a/test/full/init.lua +++ b/test/full/init.lua @@ -11,3 +11,4 @@ end require 'full.normal' require 'full.example' require 'full.dirty' +require 'full.self' diff --git a/test/full/self.lua b/test/full/self.lua new file mode 100644 index 00000000..247702ae --- /dev/null +++ b/test/full/self.lua @@ -0,0 +1,29 @@ +local files = require 'files' +local fsu = require 'fs-utility' +local furi = require 'file-uri' +local diag = require 'provider.diagnostic' +local config = require 'config' +files.removeAll() + +fsu.scanDirectory(ROOT, function (path) + if path:extension():string() ~= '.lua' then + return + end + local uri = furi.encode(path:string()) + local text = fsu.loadFile(path) + files.setText(uri, text) + files.open(uri) +end) + +config.config.diagnostics.disable['undefined-field'] = true +config.config.diagnostics.disable['redundant-parameter'] = true +diag.start() + +local clock = os.clock() + +for uri in files.eachFile() do + diag.doDiagnostic(uri) +end + +local passed = os.clock() - clock +print('基准全量诊断用时:', passed) -- cgit v1.2.3