Add some more filter tests (#4897)
This changes the `make coverage` function to use `gcovr` instead of `lcov`, and to have it generate an html file directly at `coverage/index.html` under the build directory The only thing this changes, other than adding tests, is making the `Expression` class pure virtual. Every derived class should implement each of the functions
This commit is contained in:
@@ -2,24 +2,4 @@
|
||||
|
||||
namespace chatterino::filters {
|
||||
|
||||
QVariant Expression::execute(const ContextMap & /*context*/) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
PossibleType Expression::synthesizeType(const TypingContext & /*context*/) const
|
||||
{
|
||||
return IllTyped{this, "Not implemented"};
|
||||
}
|
||||
|
||||
QString Expression::debug(const TypingContext & /*context*/) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QString Expression::filterString() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
} // namespace chatterino::filters
|
||||
|
||||
@@ -16,10 +16,10 @@ class Expression
|
||||
public:
|
||||
virtual ~Expression() = default;
|
||||
|
||||
virtual QVariant execute(const ContextMap &context) const;
|
||||
virtual PossibleType synthesizeType(const TypingContext &context) const;
|
||||
virtual QString debug(const TypingContext &context) const;
|
||||
virtual QString filterString() const;
|
||||
virtual QVariant execute(const ContextMap &context) const = 0;
|
||||
virtual PossibleType synthesizeType(const TypingContext &context) const = 0;
|
||||
virtual QString debug(const TypingContext &context) const = 0;
|
||||
virtual QString filterString() const = 0;
|
||||
};
|
||||
|
||||
using ExpressionPtr = std::unique_ptr<Expression>;
|
||||
|
||||
Reference in New Issue
Block a user