Exposing `BinaryExpr` members
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- testing-qa
Línea de trabajo
Comienza en BinaryExpr en src/catch2/internal/catch_decomposer.hpp y revisa cómo Decomposer almacena los operandos y el operador. Se considera terminado cuando el lado izquierdo, el lado derecho y el operador se exponen mediante los const accessors solicitados, actualizando o añadiendo las pruebas existentes relevantes si el proyecto requiere cobertura.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently, Catch only provides string versions of the left- and right-hand side when tests fail. For instance, something like:
CHECK( v1 == v2 )
with expansion:
{ 1, 2, 3 } == { 1, 3, 4 }
This is a good start, but it isn't enough when comparing more complicated structures, where you want some more information. pytest, for instance, will print a full diff. So you'll get something more like:
CHECK( v1 == v2 )
with expansion:
{ 1, 2, 3 } == { 1, 3, 4 }
At index 1 diff: 2 != 3
Full diff:
[
1,
- 2,
3,
+ 4,
]
Which is a lot more useful. There doesn't seem to be any way to provide more specific messages for errors. The Matcher API has no relevant hook for this.
We looked into trying to do this on our own — BinaryExpr<T, U> has the T and the U, but they are both private members with no accessors. So in order to attempt to implement something like the above, we would have to either (a) reimplement/copy the Decomposer logic, which is involved or (b) do shenanigans relying on just knowing where in BinaryExpr the T and the U are and just yolo-reinterpret-casting at specific memory locations. Neither of which I actually want to do.
It would be easier to simply add to BinaryExpr these getters:
constexpr auto lhs() const -> auto const& { return m_lhs; }
constexpr auto rhs() const -> auto const& { return m_rhs; }
constexpr auto op() const -> StringRef { return m_op; }
(Returning auto const& instead of LhsT const& since LhsT could be some T& and I'd want to unconditionally return T const& there, and auto const& is just an easier way to achieve that than something like std::remove_reference_t<LhsT> const&).
Would you be open to that addition?
- Lenguaje dominante
- C++
- Estrellas
- 21.6k
- Forks
- 3.4k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de catchorg/Catch2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
catch_discover_tests passes all EXTRA_ARGS as one argumentPosiblemente ocupada @CyberKun la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
catchorg/Catch2#3239 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Not seeing some error messages from fakeit in jetbrains riderPosiblemente ocupada @Amanpal9 la tomó hace 21 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
catchorg/Catch2#3228 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0Posiblemente ocupada @nafiurahman00 la tomó hace 8 días. AbiertoExtras
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
catchorg/Catch2#3241 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
Todos los issues de catchorg/Catch2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cp-algorithms/cp-algorithms#1774 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
telefonicaid/fiware-orion#4836 ·
Los mantenedores suelen responder en 1 día
-
nixd exits at startup when its parent process belongs to another userPosiblemente ocupada @conao3 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nix-community/nixd#930 ·
Los mantenedores suelen responder en 2 días
-
refactor topic-ui topic-weather
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Command-Install Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
microsoft/winget-cli#6718 ·
Los mantenedores suelen responder en 2 días