mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 08:55:34 +00:00
140 lines
3.6 KiB
Text
140 lines
3.6 KiB
Text
store(&VERSION) '10.0'
|
|
store(&TARGETS) 'any'
|
|
store(&NAME) 'PlatformTest'
|
|
store(&KEYBOARDVERSION) '1.0'
|
|
store(©RIGHT) '© SIL Global'
|
|
begin Unicode > use(main)
|
|
|
|
group(main) using keys
|
|
|
|
+ 'a' > use(ui)
|
|
nomatch > use(old-main)
|
|
|
|
group(ui) c Method of input (UI)
|
|
|
|
platform('touch') > 'touch'
|
|
platform('hardware') > 'hardware'
|
|
nomatch > 'undefined' use(os)
|
|
match > use(os)
|
|
|
|
group(os) c Operating system
|
|
|
|
platform('windows') > ' windows'
|
|
platform('android') > ' android'
|
|
platform('ios') > ' ios'
|
|
platform('macosx') > ' macosx'
|
|
platform('linux') > ' linux'
|
|
nomatch > ' undefined' use(ff)
|
|
match > use(ff)
|
|
|
|
group(ff) c Form factor
|
|
|
|
platform('desktop') > ' desktop'
|
|
platform('tablet') > ' tablet'
|
|
platform('phone') > ' phone'
|
|
nomatch > ' undefined' use(app)
|
|
match > use(app)
|
|
|
|
group(app) c App: Native vs KeymanWeb
|
|
|
|
platform('native') > ' native'
|
|
platform('web') > ' web'
|
|
nomatch > ' undefined' use(browser)
|
|
match > use(browser)
|
|
|
|
group(browser) c Test browser (should only return value on web)
|
|
|
|
platform('ie') > ' ie'
|
|
platform('chrome') > ' chrome'
|
|
platform('edge') > ' edge'
|
|
platform('firefox') > ' firefox'
|
|
platform('safari') > ' safari'
|
|
platform('opera') > ' opera'
|
|
nomatch > ' undefined' use(inverted)
|
|
match > use(inverted)
|
|
|
|
group(inverted) c Test for inverted rules (touch vs hardware)
|
|
|
|
if(&platform != 'touch') > ' !touch'
|
|
if(&platform != 'hardware') > ' !hardware'
|
|
nomatch > ' undefined' use(unknown)
|
|
match > use(unknown)
|
|
|
|
group(unknown) c Test for unknown platform
|
|
|
|
platform('platform-x') > ' platform-x'
|
|
nomatch > ' undefined' use(case-sensitive)
|
|
match > use(case-sensitive)
|
|
|
|
group(case-sensitive) c Test for case sensitivity
|
|
|
|
platform('WinDOWS') > ' windows'
|
|
platform('ANDroid') > ' android'
|
|
platform('iOS') > ' ios'
|
|
platform('macOSX') > ' macosx'
|
|
platform('LINUX') > ' linux'
|
|
nomatch > ' undefined'
|
|
|
|
c ----------- ----------- -----------
|
|
c Previous set of tests
|
|
c ----------- ----------- -----------
|
|
|
|
group(old-main) using keys
|
|
|
|
c P: Method of input (UI)
|
|
|
|
platform('touch') + [K_P] > 'Touch'
|
|
platform('hardware') + [K_P] > 'Hardware'
|
|
+ [K_P] > '[UI Undefined]'
|
|
|
|
c O: Operating system
|
|
|
|
platform('windows') + [K_O] > ' Windows'
|
|
platform('android') + [K_O] > ' Android'
|
|
platform('ios') + [K_O] > ' iOS'
|
|
platform('macosx') + [K_O] > ' OSX'
|
|
platform('linux') + [K_O] > ' Linux'
|
|
+ [K_O] > ' [OS Undefined]'
|
|
|
|
c I: Form factor
|
|
|
|
platform('desktop') + [K_I] > ' Desktop'
|
|
platform('tablet') + [K_I] > ' Tablet'
|
|
platform('phone') + [K_I] > ' Phone'
|
|
+ [K_I] > ' [FF Undefined]'
|
|
|
|
c U: Native vs KeymanWeb
|
|
|
|
platform('native') + [K_U] > ' Native'
|
|
platform('web') + [K_U] > ' Web'
|
|
+ [K_U] > ' [Nativeness Undefined]'
|
|
|
|
c Y: Test browser (should only return value on web)
|
|
|
|
platform('ie') + [K_Y] > ' IE'
|
|
platform('chrome') + [K_Y] > ' Chrome'
|
|
platform('edge') + [K_Y] > ' Edge'
|
|
platform('firefox') + [K_Y] > ' Firefox'
|
|
platform('safari') + [K_Y] > ' Safari'
|
|
platform('opera') + [K_Y] > ' Opera'
|
|
+ [K_Y] > ' [Browser Undefined]'
|
|
|
|
c T: Test for inverted rules (touch vs hardware)
|
|
|
|
if(&platform != 'touch') + [K_T] > ' !Touch'
|
|
if(&platform != 'hardware') + [K_T] > ' !Hardware'
|
|
+ [K_T] > ' [Inverted OS Undefined]'
|
|
|
|
c R: Test for unknown platform
|
|
|
|
platform('platform-x') + [K_R] > ' Platform-X'
|
|
+ [K_R] > ' [Platform-X Undefined]'
|
|
|
|
c E: Test for case sensitivity
|
|
|
|
platform('WinDOWS') + [K_E] > ' Windows'
|
|
platform('ANDroid') + [K_E] > ' Android'
|
|
platform('iOS') + [K_E] > ' iOS'
|
|
platform('macOSX') + [K_E] > ' macOS'
|
|
platform('LINUX') + [K_E] > ' Linux'
|
|
+ [K_E] > ' [OS Undefined (case insensitive test)]'
|