0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00
posthog/hogvm/__tests__/stl.hog

61 lines
1.6 KiB
Plaintext
Raw Normal View History

print('-- empty, notEmpty, length, lower, upper, reverse --')
if (empty('') and notEmpty('234')) print(length('123'))
if (lower('Tdd4gh') == 'tdd4gh') print(upper('test'))
print(reverse('spinner'))
2024-06-14 17:27:26 +02:00
print('')
print('-- encodeURLComponent, decodeURLComponent --')
print(encodeURLComponent('http://www.google.com'))
print(encodeURLComponent('tom & jerry'))
print(decodeURLComponent(encodeURLComponent('http://www.google.com')))
print(decodeURLComponent(encodeURLComponent('tom & jerry')))
2024-06-14 17:27:26 +02:00
print('')
print('-- base64Encode, base64Decode --')
print(base64Encode('http://www.google.com'))
print(base64Encode('tom & jerry'))
print(base64Decode(base64Encode('http://www.google.com')))
print(base64Decode(base64Encode('tom & jerry')))
2024-06-14 17:27:26 +02:00
print('')
print('-- empty --')
print(empty(null))
print(empty(0))
print(empty(1))
print(empty(-1))
print(empty(0.0))
print(empty(0.01))
print(empty(''))
print(empty('string'))
print(empty('0'))
print(empty([]))
print(empty({}))
print(empty(tuple()))
print(empty(tuple(0)))
print(empty(tuple(1,2)))
print(empty(true))
print(empty(false))
2024-06-14 17:27:26 +02:00
print('')
print('-- notEmpty --')
print(notEmpty(null))
print(notEmpty(0))
print(notEmpty(1))
print(notEmpty(-1))
print(notEmpty(0.0))
print(notEmpty(0.01))
print(notEmpty(''))
print(notEmpty('string'))
print(notEmpty('0'))
print(notEmpty([]))
print(notEmpty({}))
print(notEmpty(tuple()))
print(notEmpty(tuple(0)))
print(notEmpty(tuple(1,2)))
print(notEmpty(true))
print(notEmpty(false))
2024-06-14 17:27:26 +02:00
print('')
print('-- replaceAll, replaceOne --')
print(replaceAll('hello world', 'l', 'L'))
print(replaceOne('hello world', 'l', 'L'))
2024-06-17 11:07:32 +02:00
print('')
print('-- generateUUIDv4 --')
print(length(generateUUIDv4()))
2024-06-14 17:27:26 +02:00