Repository navigation
feat: expande biblioteca tempo com 6 novas funções - #198
Merged
Merged
Conversation
✅ Deploy Preview for idegua ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for egua canceled.
|
Member
|
@samuel-c-santos este PR já tem a expansão da biblioteca matemática junto com a expansão do tempo, portanto pode fechar o outro PR e separar a biblioteca de arquivos desse para que eu possa aprovar. |
lucaspompeun
requested changes
Aug 27, 2026
Member
There was a problem hiding this comment.
Adicionar em um PR a parte
Member
There was a problem hiding this comment.
Adicionar em um PR a parte
Comment on lines
+1701
to
+1767
| escreva("----------------------------"); | ||
|
|
||
| escreva("--------------------------------"); | ||
| escreva("Testes Internos - Biblioteca Arquivos"); | ||
| escreva("--------------------------------"); | ||
| escreva("|"); | ||
|
|
||
| var arq = importar("arquivos"); | ||
| var erros_arq = 0; | ||
|
|
||
| função testa_arquivos_existe() { | ||
| se (arq.existe("package.json") != verdadeiro) { | ||
| escreva("TESTE: arquivos.existe('package.json'): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| se (arq.existe("arquivo_inexistente.txt") != falso) { | ||
| escreva("TESTE: arquivos.existe('arquivo_inexistente.txt'): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| escreva("TESTE: arquivos.existe(): passou!"); | ||
| } | ||
|
|
||
| função testa_arquivos_salvar_leia_remova() { | ||
| arq.salvar("teste_temporario.txt", "conteudo de teste"); | ||
| se (arq.existe("teste_temporario.txt") != verdadeiro) { | ||
| escreva("TESTE: arquivos.salvar(): falhou ao criar arquivo!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| var conteudo = arq.leia("teste_temporario.txt"); | ||
| se (conteudo != "conteudo de teste") { | ||
| escreva("TESTE: arquivos.leia(): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| arq.remova("teste_temporario.txt"); | ||
| se (arq.existe("teste_temporario.txt") != falso) { | ||
| escreva("TESTE: arquivos.remova(): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| escreva("TESTE: arquivos.salvar/leia/remova(): passou!"); | ||
| } | ||
|
|
||
| função testa_arquivos_listar() { | ||
| var itens = arq.listar("."); | ||
| se (itens == nulo) { | ||
| escreva("TESTE: arquivos.listar(): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| se (tamanho(itens) == 0) { | ||
| escreva("TESTE: arquivos.listar(): falhou!"); | ||
| erros_arq = erros_arq + 1; | ||
| retorna; | ||
| } | ||
| escreva("TESTE: arquivos.listar(): passou!"); | ||
| } | ||
|
|
||
| testa_arquivos_existe(); | ||
| testa_arquivos_salvar_leia_remova(); | ||
| testa_arquivos_listar(); | ||
|
|
||
| escreva("----------------------------"); | ||
| escreva(" terminado com " + texto(erros_arq) + " erro(s)!"); |
Member
There was a problem hiding this comment.
Adicionar em um PR a parte
- tempo.dia() - dia do mês (1-31) - tempo.mes() - mês (1-12) - tempo.ano() - ano completo - tempo.dia_da_semana() - nome do dia em pt-BR - tempo.formate_data(data, formato) - formatação customizada - tempo.diferenca(data1, data2) - diferença em dias entre datas - tempo.pausa(milissegundos) - sleep/delay para scripts Todas seguem padrão ES6 com validação RuntimeError. Testes adicionados em tests/tests.egua.
samuel-c-santos
force-pushed
the
feat/expansao-tempo
branch
from
August 28, 2026 23:14
39a9af5 to
bd1938d
Compare
Contributor
Author
|
@lucaspompeun Este PR contém apenas a expansão da biblioteca tempo (6 funções). A expansão matemática está no PR #197. PRs organizados:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expansão da Biblioteca Tempo
Adiciona 6 novas funções à biblioteca
tempo:Funções
tempo.dia()— dia do mês (1-31)tempo.mes()— mês (1-12)tempo.ano()— ano completotempo.dia_da_semana()— nome do dia em português (domingo, segunda-feira, etc.)tempo.formate_data(data, formato)— formatação customizada (ex: "DD/MM/AAAA")tempo.diferenca(data1, data2)— diferença em dias entre duas datastempo.pausa(milissegundos)— sleep/delay para scriptsDetalhes
RuntimeErrorDate)tests/tests.eguaRelacionado ao ROADMAP de contribuição (Fase 2.3)