<commit_before>ProxyType  = require '../../../../src/finitio/type/proxy_type'
should     = require 'should'
{intType,
 byteType} = require '../../../spec_helpers'

describe "ProxyType#isSuperTypeOf", ->

  it "works against a real type", ->
    type = new ProxyType('int', intType)
    should(type.isSuperTypeOf(byteType)).be.true

  it "works against the other way round too", ->
    type = new ProxyType('int', byteType)
    should(intType.isSuperTypeOf(type)).be.true

  it "works against another alias type", ->
    t1 = new ProxyType('int',  intType)
    t2 = new ProxyType('byte', byteType)
    should(t1.isSuperTypeOf(t2)).be.true
<commit_msg>Make sure isSuperTypeOf works as expected.<commit_after>ProxyType  = require '../../../../src/finitio/type/proxy_type'
AliasType  = require '../../../../src/finitio/type/alias_type'
should     = require 'should'
{intType,
 byteType} = require '../../../spec_helpers'

describe "ProxyType#isSuperTypeOf", ->

  it "works against a real type", ->
    type = new ProxyType('int', intType)
    should(type.isSuperTypeOf(byteType)).be.true

  it "works against the other way round too", ->
    type = new ProxyType('int', byteType)
    should(intType.isSuperTypeOf(type)).be.true

  it "works against another proxy type", ->
    t1 = new ProxyType('int',  intType)
    t2 = new ProxyType('byte', byteType)
    should(t1.isSuperTypeOf(t2)).be.true

  it "works with an alias type", ->
    t1 = new ProxyType('int',  intType)
    t2 = new AliasType(byteType, 'byte')
    should(t1.isSuperTypeOf(t2)).be.true

  it "works against an alias type", ->
    t1 = new AliasType(intType, 'int')
    t2 = new ProxyType('byte', byteType)
    should(t1.isSuperTypeOf(t2)).be.true

{'fraction_non_alphanumeric': 0.16179906542056074, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 3.3923076923076922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '133236', 'n_tokens_mistral': 584, 'n_tokens_neox': 580, 'n_words': 140}