Skip to content

Commit

Permalink
#2119. Code format and description update in operator tests (#2238)
Browse files Browse the repository at this point in the history
Code format and description update in operator tests. Note that many of these tests have intentional syntax errors.
  • Loading branch information
sgrekhov committed Aug 25, 2023
1 parent 9103304 commit 2703b51
Show file tree
Hide file tree
Showing 65 changed files with 128 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/// A superclass of C cannot declare such an initializer either, because it must
/// necessarily declare constant constructor as well (unless it is Object, which
/// declares no instance variables)
///
/// @description Checks that compile error is produced if class declares a
/// constant constructor and its superclass has instance variable initialized
/// by non-constant expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/// by a class C if any instance variable declared in C is initialized with an
/// expression that is not a constant expression.
/// A superclass of C cannot declare such an initializer either, because it must
/// necessarily declare constant constructor as well (unless it is Object, which declares
/// no instance variables)
/// necessarily declare constant constructor as well (unless it is Object, which
/// declares no instance variables)
///
/// @description Checks that compile error is produced if class declares a
/// constant constructor and its superclass has overriden instance variable
/// constant constructor and its superclass has overridden instance variable
/// initialized by non-constant expression.
/// @author sgrekhov@unipro.ru
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
/// by a class C if any instance variable declared in C is initialized with an
/// expression that is not a constant expression.
/// A superclass of C cannot declare such an initializer either, because it must
/// necessarily declare constant constructor as well (unless it is Object, which declares
/// no instance variables)
/// necessarily declare constant constructor as well (unless it is Object, which
/// declares no instance variables)
///
/// @description Checks that compile error is produced if class declares a
/// constant constructor and its superclass has instance variable initialized
/// by non-constant expression. Test type alias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that the listed operators may indeed be defined in a
/// user class.
/// @author vasya

import "../../../../Utils/expect.dart";

class C {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator != cannot be defined in a user class.
/// @author vasya

class C {
operator !=(other) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator !== cannot be defined in a user class.
/// @author iefremov


class C {
operator !==(other) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator === cannot be defined in a user class.
/// @author iefremov

class C {
operator ===(other) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator ! cannot be defined in a user class.
/// @author iefremov

class C {
bool operator !() {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator = cannot be defined in a user class.

class C {
operator =(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator += cannot be defined in a user class.
/// @author iefremov

class C {
operator +=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator -= cannot be defined in a user class.
/// @author iefremov

class C {
operator -=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator *= cannot be defined in a user class.
/// @author iefremov

class C {
operator *=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator /= cannot be defined in a user class.
/// @author iefremov

class C {
operator /=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator ~/= cannot be defined in a user class.
/// @author iefremov

class C {
operator ~/=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator %= cannot be defined in a user class.
/// @author iefremov

class C {
operator %=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator <<= cannot be defined in a user class.
/// @author iefremov

class C {
operator <<=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator >>= cannot be defined in a user class.
/// @author iefremov

class C {
operator >>=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator &= cannot be defined in a user class.
/// @author iefremov

class C {
operator &=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator |= cannot be defined in a user class.
/// @author iefremov

class C {
operator |=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator ^= cannot be defined in a user class.
/// @author iefremov

class C {
operator ^=(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator ++ cannot be defined in a user class.
/// @author iefremov

class C {
operator ++() {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator -- cannot be defined in a user class.
/// @author iefremov

class C {
operator --() {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator is cannot be defined in a user class.
/// @author iefremov

class C {
operator is(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator && cannot be defined in a user class.
/// @author iefremov

class C {
operator &&(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator || cannot be defined in a user class.
/// @author iefremov

class C {
operator ||(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/// @assertion The following names are allowed for user-defined operators:
/// <, >, <=, >=, ==, -, +, /, ˜/, *, %, |, ˆ, &, <<, >>, >>>, []=, [], ˜.
///
/// @description Checks that operator <<< cannot be defined in a user class.
/// @author iefremov

class C {
operator <<<(x) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/// The - operator is unique in that two overloaded versions are permitted.
/// If the operator has no arguments, it denotes unary minus.
/// If it as an argument, it denotes binary subtraction.
/// @description Checks that operator - can be defined both with 0 and 1
///
/// @description Checks that operator `-` can be defined both with 0 and 1
/// arguments.
/// @author kaigorodov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
/// The - operator is unique in that two overloaded versions are permitted.
/// If the operator has no arguments, it denotes unary minus.
/// If it as an argument, it denotes binary subtraction.
///
/// @description Checks that a compile-time error is produced if a user-defined
/// operator - specifies two parameters.
/// operator `-` specifies two parameters.
/// @author kaigorodov

class C {
operator -(var val, var val2) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/// @assertion It is a compile-time error if the arity of the user-declared
/// operator ~ is not 0.
///
/// @description Checks that no compile-time error is produced if a user-defined
/// operator ~ specifies zero parameters.
/// @author kaigorodov
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

/// @assertion It is a compile-time error if the arity of the user-declared
/// operator ~ is not 0.
///
/// @description Checks that a compile-time error is produced if a user-defined
/// operator ~ specifies one parameter.
/// @author vasya

class C {
operator ~(var v) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/// @assertion It is a compile-time error if the arity of a user-declared
/// operator with one of the names:
/// <, >, <=, >=, ==, -, +, ̃/, /, *, %, |, ˆ, &, <<, >>, >>>, [] is not 1.
///
/// @description Checks that a compile-time error is produced if a user-defined
/// operator == specifies two parameters.
/// @author vasya

class C {
operator ==(var val, var val2) => true;
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/// @assertion It is a compile-time error if the arity of a user-declared
/// operator with one of the names:
/// <, >, <=, >=, ==, -, +, ̃/, /, *, %, |, ˆ, &, <<, >>, >>>, [] is not 1.
///
/// @description Checks that a compile-time error is produced if a user-defined
/// operator < specifies two parameters.
/// @author vasya

class C {
operator <(var val, var val2) {}
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/// @assertion It is a compile-time error if the arity of a user-declared
/// operator with one of the names:
/// <, >, <=, >=, ==, -, +, ̃/, /, *, %, |, ˆ, &, <<, >>, >>>, [] is not 1.
///
/// @description Checks that a compile-time error is produced if a user-defined
/// operator > specifies two parameters.
/// @author vasya

class C {
operator >(var val, var val2) {}
// ^
Expand Down

0 comments on commit 2703b51

Please sign in to comment.