Informative error message when `LoadFile` fails
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- testing-qa
Direzione di ricerca
The generic file error comes from the script-loading step in lua_test_runner.go around line 31, which hides the underlying error from the Lua load call. Start there and check what error value the load returns for a missing file versus a syntax error. Done when RunLuaTests reports the actual cause (the file path or the Lua syntax message) for both cases, and the two failure cases in the issue print distinct messages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Proposed solution
Provide more context as to what failed with the call.
Problem
At this time, both a syntax error or a missing file show up as file error:
Missing file:
func TestLuaRegexp(t *testing.T) {
l := lua.NewState()
lua.OpenLibraries(l)
regexp.Open(l)
luatest.RunLuaTests(t, l, "im_not_a_file.lua")
// luatest.RunLuaTests(t, l, "regexp_test.lua")
}
// --- FAIL: TestLuaRegexp (0.00 seconds)
// lua_test_runner.go:31: loading lua test script in VM, file error
Syntax error (in regexp_test.lua):
local re = require("goluago/regexp")
derp!
-- quotemeta
equals("quotemeta: example", "\\[foo\\]", re.quotemeta("[foo]"))
func TestLuaRegexp(t *testing.T) {
l := lua.NewState()
lua.OpenLibraries(l)
regexp.Open(l)
luatest.RunLuaTests(t, l, "regexp_test.lua")
}
// --- FAIL: TestLuaRegexp (0.00 seconds)
// lua_test_runner.go:31: loading lua test script in VM, file error
- Lingua principale
- Go
- Stelle
- 3.5k
- Fork
- 217
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Shopify/go-lua
-
Numeric modulo fast path disagrees with Lua 5.2 and the library fallback for negative operandsForse già presa @efegokdemir l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
io.write discards spaces after trailing numbersForse già presa @flynn-eye l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
State.close leaves closed upvalues in the open list, so calls get slower without boundForse già presa @efegokdemir l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Tutte le issue di Shopify/go-lua
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
docker/model-runner#1118 ·
I maintainer di solito rispondono entro 1 giorno
-
Screenshot missing in READMEAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100