-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41dc8da
commit 5affdea
Showing
15 changed files
with
635 additions
and
826 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from dataclasses import dataclass | ||
from typing import Union | ||
|
||
from acto.checker.checker import Checker, OracleResult, OracleControlFlow | ||
|
||
|
||
@dataclass | ||
class ConstantResult(OracleResult): | ||
expected: OracleControlFlow = OracleControlFlow.ok | ||
|
||
def means(self, control_flow: Union[OracleControlFlow, str])->bool: | ||
return self.expected == control_flow | ||
|
||
class ConstantChecker(Checker): | ||
name = 'constant' | ||
|
||
def __init__(self, expected: OracleControlFlow = OracleControlFlow.ok, **kwargs): | ||
super().__init__(**kwargs) | ||
self.expected = expected | ||
|
||
def _check(self, _, __) -> OracleResult: | ||
return ConstantResult(self.expected) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.