forked from GitHub/gf-core
Merge branch 'majestic' of github.com:GrammaticalFramework/gf-core into majestic
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,7 @@
|
|||||||
*.jar
|
*.jar
|
||||||
*.gfo
|
*.gfo
|
||||||
*.pgf
|
*.pgf
|
||||||
|
*.ngf
|
||||||
debian/.debhelper
|
debian/.debhelper
|
||||||
debian/debhelper-build-stamp
|
debian/debhelper-build-stamp
|
||||||
debian/gf
|
debian/gf
|
||||||
@@ -46,6 +47,8 @@ src/runtime/c/sg/.dirstamp
|
|||||||
src/runtime/c/stamp-h1
|
src/runtime/c/stamp-h1
|
||||||
src/runtime/java/.libs/
|
src/runtime/java/.libs/
|
||||||
src/runtime/python/build/
|
src/runtime/python/build/
|
||||||
|
src/runtime/python/__pycache__/
|
||||||
|
src/runtime/python/.pytest_cache/
|
||||||
.cabal-sandbox
|
.cabal-sandbox
|
||||||
cabal.sandbox.config
|
cabal.sandbox.config
|
||||||
.stack-work
|
.stack-work
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -17,11 +17,18 @@ typedef struct {
|
|||||||
|
|
||||||
extern PyTypeObject pgf_TypeType;
|
extern PyTypeObject pgf_TypeType;
|
||||||
|
|
||||||
// typedef struct {
|
typedef struct {
|
||||||
// PyObject_HEAD
|
PyObject_HEAD
|
||||||
// PyObject* master;
|
} ExprObject;
|
||||||
// GuPool* pool;
|
|
||||||
// PgfExpr expr;
|
typedef struct {
|
||||||
// } ExprObject;
|
PyObject_HEAD
|
||||||
|
int type; // 0 = int, 1 = float, 2 = str
|
||||||
|
PyObject *value; // depends on type
|
||||||
|
} ExprLitObject;
|
||||||
|
|
||||||
|
extern PyTypeObject pgf_ExprType;
|
||||||
|
|
||||||
|
extern PyTypeObject pgf_ExprLitType;
|
||||||
|
|
||||||
#endif // PYPGF_EXPR_H_
|
#endif // PYPGF_EXPR_H_
|
||||||
|
|||||||
@@ -16,58 +16,75 @@
|
|||||||
PgfExpr eabs(PgfUnmarshaller *this, PgfBindType btype, PgfText *name, PgfExpr body)
|
PgfExpr eabs(PgfUnmarshaller *this, PgfBindType btype, PgfText *name, PgfExpr body)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "eabs not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "eabs not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr eapp(PgfUnmarshaller *this, PgfExpr fun, PgfExpr arg)
|
PgfExpr eapp(PgfUnmarshaller *this, PgfExpr fun, PgfExpr arg)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "eapp not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "eapp not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr elit(PgfUnmarshaller *this, PgfLiteral lit)
|
PgfExpr elit(PgfUnmarshaller *this, PgfLiteral lit)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "elit not implemented");
|
ExprLitObject *pyexpr = (ExprLitObject *)pgf_ExprLitType.tp_alloc(&pgf_ExprLitType, 0);
|
||||||
return 0;
|
|
||||||
|
PyObject *pyobj = (PyObject *)lit;
|
||||||
|
pyexpr->value = pyobj;
|
||||||
|
|
||||||
|
if (PyLong_Check(pyobj)) {
|
||||||
|
pyexpr->type = 0;
|
||||||
|
} else if (PyFloat_Check(pyobj)) {
|
||||||
|
pyexpr->type = 1;
|
||||||
|
} else if (PyString_Check(pyobj)) {
|
||||||
|
pyexpr->type = 2;
|
||||||
|
} else {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "unable to unmarshall literal");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Py_INCREF(pyobj);
|
||||||
|
return (PgfExpr) pyexpr;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr emeta(PgfUnmarshaller *this, PgfMetaId meta)
|
PgfExpr emeta(PgfUnmarshaller *this, PgfMetaId meta)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "emeta not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "emeta not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr efun(PgfUnmarshaller *this, PgfText *name)
|
PgfExpr efun(PgfUnmarshaller *this, PgfText *name)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "efun not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "efun not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr evar(PgfUnmarshaller *this, int index)
|
PgfExpr evar(PgfUnmarshaller *this, int index)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "evar not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "evar not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr etyped(PgfUnmarshaller *this, PgfExpr expr, PgfType typ)
|
PgfExpr etyped(PgfUnmarshaller *this, PgfExpr expr, PgfType typ)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "etyped not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "etyped not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfExpr eimplarg(PgfUnmarshaller *this, PgfExpr expr)
|
PgfExpr eimplarg(PgfUnmarshaller *this, PgfExpr expr)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "eimplarg not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "eimplarg not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgfLiteral lint(PgfUnmarshaller *this, size_t size, uintmax_t *v)
|
PgfLiteral lint(PgfUnmarshaller *this, size_t size, uintmax_t *v)
|
||||||
{
|
{
|
||||||
|
intmax_t *v0 = (intmax_t *)v;
|
||||||
if (size > 1) {
|
if (size > 1) {
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "multi-part integers not implemented"); // TODO
|
PyErr_SetString(PyExc_NotImplementedError, "multi-part integers not implemented"); // TODO
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
PyObject *i = PyLong_FromUnsignedLong(*v);
|
PyObject *i = PyLong_FromLong(*v0);
|
||||||
return (PgfLiteral) i;
|
return (PgfLiteral) i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,17 +177,14 @@ object match_lit(PgfUnmarshaller *u, PgfLiteral lit)
|
|||||||
if (PyLong_Check(pyobj)) {
|
if (PyLong_Check(pyobj)) {
|
||||||
uintmax_t i = PyLong_AsUnsignedLong(pyobj);
|
uintmax_t i = PyLong_AsUnsignedLong(pyobj);
|
||||||
size_t size = 1; // TODO
|
size_t size = 1; // TODO
|
||||||
return u->vtbl->lint(NULL, size, &i);
|
return u->vtbl->lint(u, size, &i);
|
||||||
}
|
} else if (PyFloat_Check(pyobj)) {
|
||||||
else if (PyFloat_Check(pyobj)) {
|
|
||||||
double d = PyFloat_AsDouble(pyobj);
|
double d = PyFloat_AsDouble(pyobj);
|
||||||
return u->vtbl->lflt(NULL, d);
|
return u->vtbl->lflt(u, d);
|
||||||
}
|
} else if (PyString_Check(pyobj)) {
|
||||||
else if (PyString_Check(pyobj)) {
|
|
||||||
PgfText *t = PyString_AsPgfText(pyobj);
|
PgfText *t = PyString_AsPgfText(pyobj);
|
||||||
return u->vtbl->lstr(NULL, t);
|
return u->vtbl->lstr(u, t);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
PyErr_SetString(PyExc_TypeError, "unable to match on literal");
|
PyErr_SetString(PyExc_TypeError, "unable to match on literal");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -179,14 +193,14 @@ object match_lit(PgfUnmarshaller *u, PgfLiteral lit)
|
|||||||
object match_expr(PgfUnmarshaller *u, PgfExpr expr)
|
object match_expr(PgfUnmarshaller *u, PgfExpr expr)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_NotImplementedError, "match_expr not implemented");
|
PyErr_SetString(PyExc_NotImplementedError, "match_expr not implemented");
|
||||||
return 0;
|
Py_RETURN_NOTIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
object match_type(PgfUnmarshaller *u, PgfType ty)
|
object match_type(PgfUnmarshaller *u, PgfType ty)
|
||||||
{
|
{
|
||||||
TypeObject *type = (TypeObject *)ty;
|
TypeObject *type = (TypeObject *)ty;
|
||||||
|
|
||||||
PySys_WriteStdout(">%s<\n", PyUnicode_AS_DATA(type->cat));
|
// PySys_WriteStdout(">%s<\n", PyUnicode_AS_DATA(type->cat));
|
||||||
|
|
||||||
int n_hypos = 0; //PyList_Size(type->hypos);
|
int n_hypos = 0; //PyList_Size(type->hypos);
|
||||||
PgfTypeHypo *hypos = NULL; // TODO
|
PgfTypeHypo *hypos = NULL; // TODO
|
||||||
@@ -196,7 +210,7 @@ object match_type(PgfUnmarshaller *u, PgfType ty)
|
|||||||
int n_exprs = 0; //PyList_Size(type->exprs);
|
int n_exprs = 0; //PyList_Size(type->exprs);
|
||||||
PgfExpr *exprs = NULL; // TODO
|
PgfExpr *exprs = NULL; // TODO
|
||||||
|
|
||||||
return u->vtbl->dtyp(NULL, n_hypos, hypos, cat, n_exprs, exprs);
|
return u->vtbl->dtyp(u, n_hypos, hypos, cat, n_exprs, exprs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PgfMarshallerVtbl marshallerVtbl =
|
static PgfMarshallerVtbl marshallerVtbl =
|
||||||
|
|||||||
@@ -1740,7 +1740,7 @@ typedef struct {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
PGF_repr(PGFObject *self)
|
PGF_str(PGFObject *self)
|
||||||
{
|
{
|
||||||
// GuPool* tmp_pool = gu_local_pool();
|
// GuPool* tmp_pool = gu_local_pool();
|
||||||
//
|
//
|
||||||
@@ -2370,7 +2370,7 @@ static PyTypeObject pgf_PGFType = {
|
|||||||
0, /*tp_as_mapping*/
|
0, /*tp_as_mapping*/
|
||||||
0, /*tp_hash */
|
0, /*tp_hash */
|
||||||
0, /*tp_call*/
|
0, /*tp_call*/
|
||||||
(reprfunc) PGF_repr, /*tp_str*/
|
(reprfunc) PGF_str, /*tp_str*/
|
||||||
0, /*tp_getattro*/
|
0, /*tp_getattro*/
|
||||||
0, /*tp_setattro*/
|
0, /*tp_setattro*/
|
||||||
0, /*tp_as_buffer*/
|
0, /*tp_as_buffer*/
|
||||||
@@ -2477,35 +2477,27 @@ pgf_readNGF(PyObject *self, PyObject *args)
|
|||||||
return py_pgf;
|
return py_pgf;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static ExprObject*
|
static ExprObject*
|
||||||
// pgf_readExpr(PyObject *self, PyObject *args) {
|
pgf_readExpr(PyObject *self, PyObject *args)
|
||||||
// Py_ssize_t len;
|
{
|
||||||
// const uint8_t *buf;
|
const char *s;
|
||||||
// if (!PyArg_ParseTuple(args, "s#", &buf, &len))
|
Py_ssize_t size;
|
||||||
// return NULL;
|
if (!PyArg_ParseTuple(args, "s#", &s, &size))
|
||||||
//
|
return NULL;
|
||||||
// ExprObject* pyexpr = (ExprObject*) pgf_ExprType.tp_alloc(&pgf_ExprType, 0);
|
|
||||||
// if (pyexpr == NULL)
|
PgfText *input = (PgfText *)PyMem_Malloc(sizeof(PgfText)+size+1);
|
||||||
// return NULL;
|
memcpy(input->text, s, size+1);
|
||||||
//
|
input->size = size;
|
||||||
// GuPool* tmp_pool = gu_local_pool();
|
|
||||||
// GuIn* in = gu_data_in(buf, len, tmp_pool);
|
PgfExpr expr = pgf_read_expr(input, &unmarshaller);
|
||||||
// GuExn* err = gu_new_exn(tmp_pool);
|
PyMem_Free(input);
|
||||||
//
|
if (expr == 0) {
|
||||||
// pyexpr->pool = gu_new_pool();
|
PyErr_SetString(PGFError, "expression cannot be parsed");
|
||||||
// pyexpr->expr = pgf_read_expr(in, pyexpr->pool, tmp_pool, err);
|
return NULL;
|
||||||
// pyexpr->master = NULL;
|
}
|
||||||
//
|
|
||||||
// if (!gu_ok(err) || gu_variant_is_null(pyexpr->expr)) {
|
return (ExprObject *)expr;
|
||||||
// PyErr_SetString(PGFError, "The expression cannot be parsed");
|
}
|
||||||
// Py_DECREF(pyexpr);
|
|
||||||
// gu_pool_free(tmp_pool);
|
|
||||||
// return NULL;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// gu_pool_free(tmp_pool);
|
|
||||||
// return pyexpr;
|
|
||||||
// }
|
|
||||||
|
|
||||||
static TypeObject *
|
static TypeObject *
|
||||||
pgf_readType(PyObject *self, PyObject *args)
|
pgf_readType(PyObject *self, PyObject *args)
|
||||||
@@ -2536,8 +2528,8 @@ static PyMethodDef module_methods[] = {
|
|||||||
"Reads a PGF file into memory and stores the unpacked data in an NGF file"},
|
"Reads a PGF file into memory and stores the unpacked data in an NGF file"},
|
||||||
{"readNGF", (void*)pgf_readNGF, METH_VARARGS,
|
{"readNGF", (void*)pgf_readNGF, METH_VARARGS,
|
||||||
"Reads an NGF file into memory"},
|
"Reads an NGF file into memory"},
|
||||||
// {"readExpr", (void*)pgf_readExpr, METH_VARARGS,
|
{"readExpr", (void*)pgf_readExpr, METH_VARARGS,
|
||||||
// "Parses a string as an abstract tree"},
|
"Parses a string as an abstract tree"},
|
||||||
{"readType", (void*)pgf_readType, METH_VARARGS,
|
{"readType", (void*)pgf_readType, METH_VARARGS,
|
||||||
"Parses a string as an abstract type"},
|
"Parses a string as an abstract type"},
|
||||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||||
@@ -2565,6 +2557,7 @@ MOD_INIT(pgf)
|
|||||||
|
|
||||||
if (PyType_Ready(&pgf_PGFType) < 0)
|
if (PyType_Ready(&pgf_PGFType) < 0)
|
||||||
return MOD_ERROR_VAL;
|
return MOD_ERROR_VAL;
|
||||||
|
|
||||||
// if (PyType_Ready(&pgf_ConcrType) < 0)
|
// if (PyType_Ready(&pgf_ConcrType) < 0)
|
||||||
// return MOD_ERROR_VAL;
|
// return MOD_ERROR_VAL;
|
||||||
//
|
//
|
||||||
@@ -2573,9 +2566,12 @@ MOD_INIT(pgf)
|
|||||||
//
|
//
|
||||||
// if (PyType_Ready(&pgf_BINDType) < 0)
|
// if (PyType_Ready(&pgf_BINDType) < 0)
|
||||||
// return MOD_ERROR_VAL;
|
// return MOD_ERROR_VAL;
|
||||||
//
|
|
||||||
// if (PyType_Ready(&pgf_ExprType) < 0)
|
if (PyType_Ready(&pgf_ExprType) < 0)
|
||||||
// return MOD_ERROR_VAL;
|
return MOD_ERROR_VAL;
|
||||||
|
|
||||||
|
if (PyType_Ready(&pgf_ExprLitType) < 0)
|
||||||
|
return MOD_ERROR_VAL;
|
||||||
|
|
||||||
if (PyType_Ready(&pgf_TypeType) < 0)
|
if (PyType_Ready(&pgf_TypeType) < 0)
|
||||||
return MOD_ERROR_VAL;
|
return MOD_ERROR_VAL;
|
||||||
@@ -2602,8 +2598,11 @@ MOD_INIT(pgf)
|
|||||||
// PyModule_AddObject(m, "TypeError", TypeError);
|
// PyModule_AddObject(m, "TypeError", TypeError);
|
||||||
// Py_INCREF(TypeError);
|
// Py_INCREF(TypeError);
|
||||||
|
|
||||||
// PyModule_AddObject(m, "Expr", (PyObject *) &pgf_ExprType);
|
PyModule_AddObject(m, "Expr", (PyObject *) &pgf_ExprType);
|
||||||
// Py_INCREF(&pgf_ExprType);
|
Py_INCREF(&pgf_ExprType);
|
||||||
|
|
||||||
|
PyModule_AddObject(m, "ExprLit", (PyObject *) &pgf_ExprLitType);
|
||||||
|
Py_INCREF(&pgf_ExprType);
|
||||||
|
|
||||||
PyModule_AddObject(m, "Type", (PyObject *) &pgf_TypeType);
|
PyModule_AddObject(m, "Type", (PyObject *) &pgf_TypeType);
|
||||||
Py_INCREF(&pgf_TypeType);
|
Py_INCREF(&pgf_TypeType);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if libraries==['']:
|
|||||||
|
|
||||||
pgf_module = Extension('pgf',
|
pgf_module = Extension('pgf',
|
||||||
sources = ['pypgf.c', 'marshaller.c', 'expr.c'],
|
sources = ['pypgf.c', 'marshaller.c', 'expr.c'],
|
||||||
extra_compile_args = ['-std=c99', '-Werror', '-Wno-comment'],
|
extra_compile_args = ['-std=c99', '-Werror', '-Wno-error=int-conversion', '-Wno-comment'],
|
||||||
include_dirs = includes,
|
include_dirs = includes,
|
||||||
library_dirs = libraries,
|
library_dirs = libraries,
|
||||||
libraries = ['pgf'])
|
libraries = ['pgf'])
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ def test_readNGF(NGF):
|
|||||||
pgf.readNGF("./basic.ngf")
|
pgf.readNGF("./basic.ngf")
|
||||||
# TODO assert read actually worked
|
# TODO assert read actually worked
|
||||||
|
|
||||||
# abstract expressions
|
# abstract syntax
|
||||||
|
|
||||||
def test_abstractName(PGF):
|
def test_abstractName(PGF):
|
||||||
assert PGF.abstractName == "basic"
|
assert PGF.abstractName == "basic"
|
||||||
@@ -84,6 +84,8 @@ def test_functionsByCat_2(PGF):
|
|||||||
def test_functionsByCat_non_existant(PGF):
|
def test_functionsByCat_non_existant(PGF):
|
||||||
assert PGF.functionsByCat("X") == []
|
assert PGF.functionsByCat("X") == []
|
||||||
|
|
||||||
|
# types
|
||||||
|
|
||||||
def test_readType_invalid():
|
def test_readType_invalid():
|
||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.readType("->")
|
pgf.readType("->")
|
||||||
@@ -103,7 +105,7 @@ def test_readType_inequality_1():
|
|||||||
def test_readType_inequality_2():
|
def test_readType_inequality_2():
|
||||||
assert pgf.readType("A -> B") != pgf.readType("B->B")
|
assert pgf.readType("A -> B") != pgf.readType("B->B")
|
||||||
|
|
||||||
# def test_Type_str_1():
|
# def test_readType_str():
|
||||||
# assert str(pgf.readType("A-> B")) == "A -> B"
|
# assert str(pgf.readType("A-> B")) == "A -> B"
|
||||||
|
|
||||||
def test_functionType_1(PGF):
|
def test_functionType_1(PGF):
|
||||||
@@ -123,6 +125,40 @@ def test_functionType_wrong(PGF):
|
|||||||
assert PGF.functionType("c") != pgf.readType("N -> S -> X")
|
assert PGF.functionType("c") != pgf.readType("N -> S -> X")
|
||||||
|
|
||||||
def test_startCat(PGF):
|
def test_startCat(PGF):
|
||||||
# with pytest.raises(pgf.PGFError):
|
|
||||||
# PGF.startCat
|
|
||||||
assert PGF.startCat == pgf.readType("S")
|
assert PGF.startCat == pgf.readType("S")
|
||||||
|
|
||||||
|
# expressions
|
||||||
|
|
||||||
|
def test_readExpr_invalid():
|
||||||
|
with pytest.raises(pgf.PGFError):
|
||||||
|
pgf.readExpr("->")
|
||||||
|
|
||||||
|
def test_readExpr_equality_int():
|
||||||
|
assert pgf.readExpr("123") == pgf.readExpr("123")
|
||||||
|
|
||||||
|
def test_readExpr_equality_int_neg():
|
||||||
|
assert pgf.readExpr("-123") == pgf.readExpr("-123")
|
||||||
|
|
||||||
|
# def test_readExpr_equality_int_big():
|
||||||
|
# assert pgf.readExpr("774763251095801167872") == pgf.readExpr("774763251095801167872")
|
||||||
|
|
||||||
|
# def test_readExpr_equality_int_big_neg():
|
||||||
|
# assert pgf.readExpr("-774763251095801167872") == pgf.readExpr("-774763251095801167872")
|
||||||
|
|
||||||
|
def test_readExpr_inequality_int():
|
||||||
|
assert pgf.readExpr("123") != pgf.readExpr("456")
|
||||||
|
|
||||||
|
def test_readExpr_equality_float():
|
||||||
|
assert pgf.readExpr("3.142") == pgf.readExpr("3.142")
|
||||||
|
|
||||||
|
def test_readExpr_inequality_float():
|
||||||
|
assert pgf.readExpr("3.142") != pgf.readExpr("3")
|
||||||
|
|
||||||
|
def test_readExpr_equality_string():
|
||||||
|
assert pgf.readExpr("\"abc\"") == pgf.readExpr("\"abc\"")
|
||||||
|
|
||||||
|
def test_readExpr_inequality_string():
|
||||||
|
assert pgf.readExpr("\"abc\"") != pgf.readExpr("\"def\"")
|
||||||
|
|
||||||
|
# def test_readExpr_str_int():
|
||||||
|
# assert str(pgf.readExpr("123")) == "123"
|
||||||
|
|||||||
Reference in New Issue
Block a user