#%Module
module-alias hide2/1.3 hide2/1.0
module-version hide2/1.0 1.4

if {[info exists env(TESTSUITE_HIDE2_SET8)]} {
    module-hide hide2@1.3 hide2@1.4
    # following statements should not have any impact on hide2 modules
    module-hide hid
    module-hide hide
}
# test cascading definition with small match here and big match in module-specific rc file
if {[info exists env(TESTSUITE_HIDE3_SET1)]} {
    module-hide hide3/1.0
}
if {[info exists env(TESTSUITE_HIDE3_SET2)]} {
    module-hide hide3/sub2
}
if {[info exists env(TESTSUITE_HIDE3_SET3)]} {
    module-hide hide3/sym
}
if {[info exists env(TESTSUITE_HIDE3_SET4)]} {
    module-hide hide3/sub2 @default hide3/sub1/2.0
}

# test module-hide --soft cascading definition
if {[info exists env(TESTSUITE_HIDE3_SOFT_SET1)]} {
    module-hide --soft hide3/1.0
}
if {[info exists env(TESTSUITE_HIDE3_SOFT_SET2)]} {
    module-hide --soft hide3/sub2
}
if {[info exists env(TESTSUITE_HIDE3_SOFT_SET3)]} {
    module-hide --soft hide3/sym
}
if {[info exists env(TESTSUITE_HIDE3_SOFT_SET4)]} {
    module-hide hide3/sub2 @default hide3/sub1/2.0 --soft
}

# 20/119 module-hide/module-forbid cascading tests
if {[info exists env(TESTSUITE_HIDE1_CASC_SET1)]} {
    module-hide hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET2)]} {
    module-hide --soft hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET3)]} {
    module-hide --soft hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET4)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET5)]} {
    module-hide hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET6)]} {
    module-hide --soft hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET7)]} {
    module-hide hide1 --hidden-loaded
}
if {[info exists env(TESTSUITE_HIDE1_CASC_SET8)]} {
    module-hide --soft hide1 --hidden-loaded
}

if {[info exists env(TESTSUITE_HIDE4_CASC_SET1)]} {
    module-hide hide4
}
if {[info exists env(TESTSUITE_HIDE4_CASC_SET2)]} {
    module-hide --soft hide4
}

if {[info exists env(TESTSUITE_HIDE1_CASC2_SET1)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET2)]} {
    module-hide --not-user [module-info username] hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET3)]} {
    module-hide --not-user [module-info username] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET4)]} {
    module-hide hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET5)]} {
    module-hide --soft hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET6)]} {
    module-hide --not-user [module-info username] hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET7)]} {
    module-hide --soft --not-user [module-info username] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC2_SET8)]} {
    module-hide hide1
}

if {[info exists env(TESTSUITE_HIDE1_CASC3_SET1)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET2)]} {
    module-hide --not-group [module-info usergroups] hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET3)]} {
    module-hide --not-group [module-info usergroups] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET4)]} {
    module-hide hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET5)]} {
    module-hide --soft hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET6)]} {
    module-hide --not-group [module-info usergroups] hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET7)]} {
    module-hide --soft --not-group [module-info usergroups] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC3_SET8)]} {
    module-hide hide1
}

if {[info exists env(TESTSUITE_HIDE1_CASC4_SET1)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC4_SET2)]} {
    module-forbid hide1/5.0
    module-hide --hard hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC4_SET6)]} {
    module-hide --hard --not-user [module-info username] hide1/5.0
    module-forbid --not-user [module-info username] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC4_SET7)]} {
    module-forbid hide1/5.0
    module-forbid hide1/5.0
}

if {[info exists env(TESTSUITE_HIDE4_CASC2_SET1)]} {
    module-forbid hide4
    module-hide --hard hide4
}

# 20/115 module-forbid tests
if {[info exists env(TESTSUITE_FORBID2_SET8)]} {
    module-forbid hide2@1.3 hide2@1.4
    module-hide --hard hide2@1.3 hide2@1.4
    # following statements should not have any impact on hide2 modules
    module-forbid hid
    module-hide --hard hid
    module-forbid hide
    module-hide --hard hide
}
# test cascading definition with small match here and big match in module-specific rc file
if {[info exists env(TESTSUITE_FORBID3_SET1)]} {
    module-forbid hide3/1.0
    module-hide --hard hide3/1.0
}

# 20/111 module-hide --hard tests
if {[info exists env(TESTSUITE_HIDE2_HARD_SET8)]} {
    module-hide --hard hide2@1.3 hide2@1.4
    # following statements should not have any impact on hide2 modules
    module-hide --hard hid
    module-hide --hard hide
}
# test cascading definition with small match here and big match in module-specific rc file
if {[info exists env(TESTSUITE_HIDE3_HARD_SET1)]} {
    module-hide --hard hide3/1.0
}
if {[info exists env(TESTSUITE_HIDE3_HARD_SET2)]} {
    module-hide --hard hide3/sub2
}
if {[info exists env(TESTSUITE_HIDE3_HARD_SET3)]} {
    module-hide --hard hide3/sym
}
if {[info exists env(TESTSUITE_HIDE3_HARD_SET4)]} {
    module-hide --hard hide3/sub2 @default hide3/sub1/2.0
}

# 20/119 module-hide --hard cascading tests
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET1)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET2)]} {
    module-hide --hard hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET3)]} {
    module-hide --soft hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET4)]} {
    module-hide --soft --hard hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET5)]} {
    module-hide hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET6)]} {
    module-hide --hard --not-user [module-info username] hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET7)]} {
    module-hide --hard hide1/5.0
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET8)]} {
    module-hide --hard hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET9)]} {
    module-hide hide1
}
if {[info exists env(TESTSUITE_HIDE1_CASC7_SET10)]} {
    module-hide --hard hide1/5.0
}

if {[info exists env(TESTSUITE_HIDE4_CASC3_SET1)]} {
    module-hide --hard hide4
}


