CodeSampleX

Exemplo

Jinja2 strips a single trailing newline from the end of a template by default, unless keep_trailing_newline is True.

sha256:151132e403f9a779c9ff2830e0b4b238d3ad9e805142f28d60695f1b07a1318a

Estado de publicação. LOCAL_PASS passou apenas no ambiente do autor; PUBLISHED é público e aguarda verificação independente; CROSS_PASS foi reproduzido por outro verificador; MATRIX_PASS passou entre ambientes diferentes; STABLE mantém aprovações independentes sem falhas recentes. Força da evidência. L0 tem apenas o código-fonte; L1 resolveu dependências; L2 compilou ou carregou; L3 passou no contrato; L4 foi reproduzido de forma independente; L5 passou em ambientes diferentes. MIT-0

Evidência de execução

O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.

Base da evidência
Verificação cruzada independente
Recibos de verificação
2
Nível de verificação
L4_CROSS_PASS

Ambiente declarado

Contexto de execução
python
Sistema operacional
linux
Arquitetura
x64
Runtime
python
Linguagem
python
Gerenciador de pacotes
pip

Ambientes das execuções de verificação

python 3.12 · linux alpine/x64 · docker PASS
Contexto de execução
python 3.12
Sistema operacional
linux alpine · musl
Arquitetura
x64
Runtime
python 3.12
Linguagem
python
Gerenciador de pacotes
pip
Execução
container · docker

CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-18

python 3.12 · linux alpine/x64 · docker PASS
Contexto de execução
python 3.12
Sistema operacional
linux alpine · musl
Arquitetura
x64
Runtime
python 3.12
Linguagem
python
Gerenciador de pacotes
pip
Execução
container · docker

CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-18

Caso

HOW
Objetivo
Jinja2 strips a single trailing newline from the end of a template by default, unless keep_trailing_newline is True.
Pacotes
Símbolos
  • keep_trailing_newline
Ambiente
python
Criado
2026-08-18T09:45:40Z

Contrato

  1. Environment().from_string('hello\n').render() returns 'hello' rather than 'hello\n', because the default is to strip exactly one trailing newline.
  2. assert jinja2.Environment().from_string('hello\n').render() == 'hello'
  3. assert jinja2.Environment().from_string('hello\n\n').render() == 'hello\n'
  4. assert jinja2.Environment(keep_trailing_newline=True).from_string('hello\n').render() == 'hello\n'

Arquivos

  • NOTES.md
  • csx.json
  • requirements.txt
  • test/contract.py

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed

Recibos de verificação

  • python 3.12 · linux alpine/x64 · docker PASS
    CONTAINER_RUN compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS python@1
    ed25519:d91480838ac982c9
  • python 3.12 · linux alpine/x64 · docker PASS
    CONTAINER_RUN compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS python@1
    ed25519:2175b912ea1c23b1