#!/usr/bin/env python
#
# New SWIG releases produce
# non-coercing code. This checks for it.
#

import coral

L1 = coral.Language.__getLanguage__("UML", 1, 4)

s = coral.String.newAtom()
s.__setString__("UML")
L2 = coral.Language.__getLanguage__(s, 1, 4)
assert L1 == L2

i1 = coral.Integer.newAtom()
i1.__setIValue__(1)
L3 = coral.Language.__getLanguage__(s, i1, 4)
assert L1 == L3

i2 = coral.Integer.newAtom()
i2.__setIValue__(4)
L4 = coral.Language.__getLanguage__(s, i1, i2)
assert L1 == L4

L5 = coral.Language.__getLanguage__(s, 1, i2)
assert L1 == L5

L6 = coral.Language.__getLanguage__("UML", 1, i2)
assert L1 == L6
