Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add org/python/types/Object tests #905

Merged
merged 25 commits into from Aug 31, 2018
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c842279
add object type tests
patiences Aug 10, 2018
8cde51f
add object type tests
patiences Aug 10, 2018
499f72b
Merge branch 'object-tests' of https://github.com/patiences/voc into …
patiences Aug 10, 2018
38c4c9a
Add operations tests for object and bug fixes
patiences Aug 16, 2018
32c3024
fix tests for builtins
patiences Aug 16, 2018
db0e58c
fix imul and unexpected successes
patiences Aug 16, 2018
9da07bb
fix test failures
patiences Aug 16, 2018
3fb9e6b
fix __getitem__ error message in Object.java
patiences Aug 16, 2018
df53ff4
fix javacheckstyle
patiences Aug 16, 2018
4a9bc7d
remove duplicated invert, pos, neg methods
patiences Aug 16, 2018
e96ba5b
fix trailing space
patiences Aug 16, 2018
cb9d10c
fix test failures
patiences Aug 16, 2018
17a62a8
add more obj tests to not_implemented
patiences Aug 17, 2018
56cced9
Reorder obj in SAMPLE_DATA
patiences Aug 17, 2018
b36b336
add flakey test
patiences Aug 17, 2018
6f5a8c1
fix test failures
patiences Aug 17, 2018
90997a5
remove object() datatype
patiences Aug 21, 2018
01e5d4d
add object() type and type(object, (object,), {})
patiences Aug 22, 2018
4c704f6
really add object() datatype
patiences Aug 22, 2018
3ca18dc
Merge branch 'master' into object-tests
patiences Aug 22, 2018
9805e5d
fix javacheckstyle
patiences Aug 22, 2018
d6cf509
retrigger build
patiences Aug 22, 2018
df710f0
fix javacheckstyle again
patiences Aug 22, 2018
1dbdf7b
fix test failures and unexpected successes
patiences Aug 22, 2018
a36073d
fix test failures again
patiences Aug 22, 2018
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

remove duplicated invert, pos, neg methods

  • Loading branch information...
patiences committed Aug 16, 2018
commit 4a9bc7d5b73cc1e1bee2809e0488657b1a40f9bf
@@ -185,27 +185,6 @@ public ByteArray(org.python.Object[] args, java.util.Map<java.lang.String, org.p
throw new org.python.exceptions.TypeError("unsupported operand type(s) for &: '" + this.typeName() + "' and '" + other.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: '" + this.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: '" + this.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: '" + this.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
@@ -211,27 +211,6 @@ public Bytes(org.python.Object[] args, java.util.Map<java.lang.String, org.pytho
throw new org.python.exceptions.TypeError("unsupported operand type(s) for &: 'bytes' and '" + other.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'bytes'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'bytes'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'bytes'");
}

@org.python.Method(
__doc__ = ""
)
@@ -688,13 +688,6 @@ public boolean __setattr_null(java.lang.String name, org.python.Object value) {
return new org.python.types.Float(java.lang.Math.sqrt(real * real + imag * imag));
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'complex'");
}

@org.python.Method(
__doc__ = "int(self)"
)
@@ -151,28 +151,7 @@ public Dict(org.python.Object[] args, java.util.Map<java.lang.String, org.python
public org.python.types.Str __format__(org.python.Object other) {
throw new org.python.exceptions.NotImplementedError("dict.__format__() has not been implemented.");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'dict'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'dict'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'dict'");
}


@org.python.Method(
__doc__ = ""
)
@@ -91,27 +91,6 @@ public boolean __delattr_null(java.lang.String name) {
return false;
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'dict_items'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'dict_items'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'dict_items'");
}

@org.python.Method(
__doc__ = ""
)
@@ -118,27 +118,6 @@ public void __delitem__(org.python.Object item) {
throw new org.python.exceptions.TypeError("'dict_keys' object doesn't support item deletion");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'dict_keys'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'dict_keys'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'dict_keys'");
}

@org.python.Method(
__doc__ = "Return self&value."
)
@@ -81,27 +81,6 @@ public boolean __delattr_null(java.lang.String name) {
return false;
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'dict_values'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'dict_values'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'dict_values'");
}

@org.python.Method(
__doc__ = ""
)
@@ -662,14 +662,7 @@ public boolean __setattr_null(java.lang.String name, org.python.Object value) {
throw new org.python.exceptions.TypeError("unsupported operand type(s) for round(): 'float' and '" + ndigits.typeName() + "'");
}
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'float'");
}


@org.python.Method(
__doc__ = "F.is_integer() -> bool\n" +
"\n" +
@@ -76,34 +76,13 @@ public FrozenSet(org.python.Object[] args, java.util.Map<java.lang.String, org.p
}
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'frozenset'");
}

@org.python.Method(
__doc__ = "Implement iter(self)."
)
public org.python.Object __iter__() {
return new org.python.types.Set_Iterator(this);
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'frozenset'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'frozenset'");
}

@org.python.Method(
__doc__ = ""
)
@@ -91,20 +91,6 @@ public List(org.python.Object[] args, java.util.Map<java.lang.String, org.python
// throw new org.python.exceptions.NotImplementedError("list.__init__() has not been implemented.");
// }

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'list'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'list'");
}

@org.python.Method(
__doc__ = "Implement self+=value.",
args = {"other"}
@@ -150,13 +136,6 @@ public List(org.python.Object[] args, java.util.Map<java.lang.String, org.python
return this;
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'list'");
}

@org.python.Method(
__doc__ = ""
)
@@ -9,13 +9,6 @@
NoneType() {
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'NoneType'");
}

@org.python.Method(
__doc__ = ""
)
@@ -30,20 +23,6 @@
throw new org.python.exceptions.TypeError("unsupported operand type(s) for >>=: 'NoneType' and '" + other.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'NoneType'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'NoneType'");
}

@org.python.Method(
__doc__ = ""
)
@@ -22,27 +22,6 @@ public boolean __setattr_null(java.lang.String name, org.python.Object value) {
return false;
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'NotImplementedType'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'NotImplementedType'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'NotImplementedType'");
}

@org.python.Method(
__doc__ = ""
)
@@ -953,14 +953,14 @@ public void __delitem__(org.python.Object index) {
__doc__ = ""
)
public org.python.Object __neg__() {
throw new org.python.exceptions.TypeError("bad operand type for unary -: 'type'");
throw new org.python.exceptions.TypeError("bad operand type for unary -: '" + this.typeName() + "'");
}

@org.python.Method(
__doc__ = ""
)
public org.python.Object __pos__() {
throw new org.python.exceptions.TypeError("bad operand type for unary +: 'type'");
throw new org.python.exceptions.TypeError("bad operand type for unary +: '" + this.typeName() + "'");
}

@org.python.Method(
@@ -974,7 +974,7 @@ public void __delitem__(org.python.Object index) {
__doc__ = ""
)
public org.python.Object __invert__() {
throw new org.python.exceptions.TypeError("bad operand type for unary ~: 'type'");
throw new org.python.exceptions.TypeError("bad operand type for unary ~: '" + this.typeName() + "'");
}

@org.python.Method(
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.