checker

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package checker contains different implementation of the interface defined as github.com/mraron/njudge/pkg/problems.Checker

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoWhitediff

func DoWhitediff(a io.Reader, b io.Reader) (float64, error)

DoWhitediff performs a whitediff comparision on the two input readers. It returns:

  • "1.0" if the streams match,
  • "0.0" if not,

and any errors encountered while trying to exhaust the readers.

Types

type Ellen

type Ellen struct {
	// contains filtered or unexported fields
}

Ellen (an abbreviation of checker in hungarian) checker is used by mester, bíró systems.

Arguments of the checker are:

  1. Absolute path to testdata
  2. Absolute path to output data
  3. Index of testcase to check

Testcases are named in.{x} and out.{x} where x is an 1 indexed integer.

It produces its output to stdout in the following format:

{test_index};{subtest_number};{point_multiplier};{verdict_message}

  • test_index: the index received via the argument
  • subtest_number: refer to the github.com/mraron/njudge/pkg/problems/config/feladat_txt config's docs
  • point_multiplier: 0 or 1, depending on the correctness
  • verdict_message: A message displayed to the user (it must not contain ";" or ":" characters)

If there are multiple subtests the same format should be used delimited by a single ":"

func NewEllen

func NewEllen(ellenPath, testcaseDir string, testCount int, points []int) Ellen

func (Ellen) Check

func (f Ellen) Check(tc *problems.Testcase) error

func (Ellen) Name

func (Ellen) Name() string

type Noop

type Noop struct{}

Noop doesn't perform any checking

func (Noop) Check

func (Noop) Check(testcase *problems.Testcase) error

func (Noop) Name

func (Noop) Name() string

type TaskYAML

type TaskYAML struct {
	// contains filtered or unexported fields
}

TaskYAML checker format is used by CMS as described in the CMS documentation's Checker and Standard manager output sections.

func NewTaskYAML

func NewTaskYAML(path string) *TaskYAML

func (*TaskYAML) Check

func (t *TaskYAML) Check(tc *problems.Testcase) error

func (*TaskYAML) Name

func (t *TaskYAML) Name() string

type Testlib

type Testlib struct {
	// contains filtered or unexported fields
}

Testlib is polygon's default checker format

func NewTestlib

func NewTestlib(path string) Testlib

func (Testlib) Check

func (t Testlib) Check(tc *problems.Testcase) error

func (Testlib) Name

func (Testlib) Name() string

type Whitediff

type Whitediff struct{}

Whitediff is the default checker built into CMS

func (Whitediff) Check

func (Whitediff) Check(tc *problems.Testcase) error

func (Whitediff) Name

func (Whitediff) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL