---
title: "ResultVerifier"
description: "Allows a custom verification of a result of a snippet execution."
kind: "interface"
id: "org.graalvm.polyglot.tck.ResultVerifier"
module: "polyglot-tck"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/polyglot-tck/org/graalvm/polyglot/tck/ResultVerifier.html"
---

# ◇ ResultVerifier

[polyglot-tck](../../../../index.md) › [org.graalvm.polyglot.tck](index.md) · Every page: [llms.txt](../../../../llms.txt)

Interface in [`org.graalvm.polyglot.tck`](index.md). Since 0.30.

```java
public interface ResultVerifier extends Consumer<ResultVerifier.SnippetRun>
```

Extends: [`Consumer`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Consumer.html)`<`[`ResultVerifier.SnippetRun`](ResultVerifier.SnippetRun.md)`>`

Allows a custom verification of a result of a snippet execution.

## Nested types

- [`ResultVerifier.SnippetRun`](ResultVerifier.SnippetRun.md) (class): Provides the test execution data.

## Methods

### accept(ResultVerifier.SnippetRun)
<a id="accept(org.graalvm.polyglot.tck.ResultVerifier.SnippetRun)"></a>`void accept(ResultVerifier.SnippetRun snippetRun) throws PolyglotException`. Since 0.30. Performs a verification of a result of a snippet execution. The custom `ResultVerifier` overrides the default snippet execution verification. The default verification tests that the result type is in bounds specified by the `Snippet`. The custom `ResultVerifier` can be used to do additional checking of a result or an execution exception throwing [`AssertionError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AssertionError.html) in case of failed assertion. The custom `ResultVerifier` can hide an expected execution exception. For example the division operator snippet may provide a custom `ResultVerifier` hiding the execution exception for division by zero. To propagate the execution exception the `ResultVerifier` should re-throw it. The `ResultVerifier` can be used to resolve problems in the `ErrorTypeTest` by making the `Snippet`'s parameter(s) more generic and restrict the required value in the verifier. Parameters: `snippetRun` `ResultVerifier.SnippetRun`: the snippet execution data. The `SnippetRun` provides the actual snippet parameters, the execution result, or the [`PolyglotException`](https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/polyglot/PolyglotException.html) thrown by the execution. If the snippet execution throws an [`IllegalArgumentException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/IllegalArgumentException.html), it's converted to [`PolyglotException`](https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/polyglot/PolyglotException.html). Throws: `PolyglotException`: may propagate the [`PolyglotException`](https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/polyglot/PolyglotException.html) from the snippetRun. `AssertionError` (unchecked): may throw an [`AssertionError`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/AssertionError.html) as a result of a verification. Overrides `accept(T)`. Cite: `org/graalvm/polyglot/tck/ResultVerifier.html#accept(org.graalvm.polyglot.tck.ResultVerifier.SnippetRun)`

### getDefaultResultVerifier()
<a id="getDefaultResultVerifier()"></a>`static ResultVerifier getDefaultResultVerifier()`. Since 19.0. Creates a default `ResultVerifier`. The default `ResultVerifier` tests that the result type is in bounds specified by the `Snippet`. Returns `ResultVerifier`: the default `ResultVerifier`. Cite: `org/graalvm/polyglot/tck/ResultVerifier.html#getDefaultResultVerifier()`

### getIdentityFunctionDefaultResultVerifier()
<a id="getIdentityFunctionDefaultResultVerifier()"></a>`static ResultVerifier getIdentityFunctionDefaultResultVerifier()`. Since 19.1.0. Creates a default `ResultVerifier` for the `IdentityFunctionTest`. The returned `ResultVerifier` tests that the identity function does not change the parameter type. Returns `ResultVerifier`: the default `ResultVerifier` for `IdentityFunctionTest`. Cite: `org/graalvm/polyglot/tck/ResultVerifier.html#getIdentityFunctionDefaultResultVerifier()`

## Inherited members

- From interface [`Consumer`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Consumer.html): [`andThen`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Consumer.html#andThen%28java.util.function.Consumer%29)
