Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

1.7 KB
Raw Blame

BuildKit test fixtures

Test data from moby/buildkit v0.26.1 (frontend/dockerfile, Apache License 2.0).

  • parser/: verbatim copies of parser/testfiles, parser/testfiles-negative and parser/testfile-line. Each result is the Node.Dump() output of the upstream parser.

  • shell/envVarTest.env.json: the Unix/All lines of shell/envVarTest with the upstream expectations verbatim (TestShellParser4EnvVars: the environment is PWD=/home SHELL=bash KOREAN=한국어 NULL=, unset variables expand to an empty string).

  • shell/wordsTest.env.json: the lines of shell/wordsTest with the ENV lines applied cumulatively, upstream expectations verbatim (TestShellParser4Words, normal mode; unset variables expand to an empty string).

  • shell/processWithMatches.json: the TestProcessWithMatches table from shell/lex_test.go (input, environment, expected word or error).

  • shell/: the inputs of shell/wordsTest and shell/envVarTest with expectations generated by the upstream lexer in its variable-preserving mode (BuildKit's SkipUnsetEnv with an empty environment), which is how this lexer behaves without an env:

    lex := shell.NewLex('\\')
    lex.SkipUnsetEnv = true
    lex.RawQuotes = rawQuotes // wordsTest.rawQuotes.json
    env := shell.EnvsFromSlice(nil)
    word, _, err := lex.ProcessWord(input, env)
    words, err := lex.ProcessWords(input, env)
    

    ProcessWords upstream loses the text before a ${VAR<modifier>...} expression (he${XXX:-000}xx → ${XXX:-000}xx): the nested processStopOn call for the modifier resets the shared words buffer. The words of those envVarTest.json entries are the intact words, the upstream output is kept as buildkitWords.