RhostMUSH / trunk

RhostMUSH 4.0: This is the official main repository of RhostMUSH. Visit us at rhostdev.mushpark.com 4201
23 stars 21 forks source link

UTF-8 Testing #178

Open thenomain opened 1 year ago

thenomain commented 1 year ago

Testing functions listed under 'help functions classes' string category. Not all string functions are listed there. Made it up to the Rs so far. More to come.

Each line is more or less: FUNCTION() - test - outcome

(edit:) Lines with ~~text~~ new outcome [OK] are meant to be strike thru and the result of the new test, but Github and Strikethru do not seem to be getting along for me.

================================================================================
== OUTPUT ISSUES ===============================================================

These are functions that seem to work fine internally but do not output UTF8 
correctly.

~~CENTER() - center( thîs, 10 ) - center( this, 10, î ) - both are a mess~~ Looking good! [OK]
ESCAPE() - escape( thîs test ) - \th\%<u00ee>s test
ESCAPEX() - escapex( thîs test, fasdpx ) - th\%<u00ee>s test
          - works with escapex( thîs test, fx, < ), but rather non-intuitive
          - PLEASE ADD '8' FLAG TO IGNORE UTF-8/ACCENTS! KTHX!
ESCLIST() - esclist( î|thîs test ) - th\%\<\u\0\0\e\e\>s t\est - th\%<u00ee>s test [OK I THINK?]

================================================================================
== LOGIC ISSUES ================================================================

These are functions that are not processed correctly. May also have output 
issues.

~~CREPLACE() - creplace( this is, 3, î ) - th?~~ thîs is [OK]
           ~~- creplace( thîs is, 3, + ) - th+<u00ee>s is~~ th+s is [OK]
DELETE() - delete( thîs test, 3, 1 ) - th%u00ee>s test
~~ELEMENTPOS() - elementpos( thîs test, 3 7 ) - ? e~~ î e [OK]
             ~~- elementpos( thisîtest, 3 7, î ) - I%e~~ iîe [OK]]
ISALNUM() - isalnum( î ) - 0 - (technically yes? feels wrong)
ISALPHA() - see above
ISPUNCT() - ispunct( î ) - 1
ISWORD() - isword( î ) - 0
LEFT() - left( thîs test, 3 ) - th%
RIGHT() - right( thîs tést, 3 ) - >st
~~LIT() - lit( thîs test ) - th?s test~~ thîs test [OK]
~~LJC() - ljc( thîs test, 3 ) - th%~~ thî [OK]
             ~~- '[ljc( thîs test, 13 )]' - 'th?s t'~~ 'thîs test    ' [OK]
MERGE() - merge( th-s test, thîs test, - ) - #-1 STRING LENGTHS MUST BE EQUAL
MID() - mid( thîs test, 3, 1 ) - < 
NOTCHR() - notchr( thîs test, ü ) - 0
NUMPOS() - numpos( î, thîs tîst ) - 2 [OK]
         - numpos( î, thîs test, 1 ) - 9 - no. - `numpos( î, thîs test, 1` - [STILL BAD]
ORCHR() - orchr( thîs test, ü ) - 1
POS() - pos( ü, thîs test ) - #-1  - [OK]
      - pos( î, thîs test ) - 3 - [OK]
      - pos( ü, thîs test, 1 ) - 3 - [STILL BAD]
TEMPLATE() - template( 000, üîø ) - 2 [HEE HEE]

================================================================================
== SEEM FINE ===================================================================

Yes, this is a category of functions that seem to be fine. This category is 
partially here in order to verify which functions have been tested.

AFTER() - after( thîs test, î ) - s test
ANDCHR() - andchr( thîs test, î ) - 1
BEFORE() - before( thîs test, î ) - th
CASE() - case( î, î, yes, no ) - yes
CASEALL() - see above
COMP() - seems fine
DECODE64() - decode64( encode64( thîs is )) - thîs is
ENCODE64() - decode64( encode64( thîs is )) - thîs is
RANDPOS() - randpos( ü, thîs tîst ) - null  - correct!
          - randpos( î, thîs tîst ) - 14 3 - 100% A++!!!

CAPSTR() - capstr( thîs test ) - Th?s test -- user error, works
CAT() - cat( thîs, test ) - th?s test -- user error, works
CHOMP() - '[chomp( %rthîs%r, b )]' - 'th?s' -- user error, works
DECRYPT() - decrypt( encrypt( thîs is, thîs is ), thîs is ) - th?s is
ENCRYPT() - decrypt( encrypt( thîs is, thîs is ), thîs is ) - th?s is
          - user error, works
EDIT() - edit( thîs test, thîs, thåt ) - th?t test -- user error, works
EDITANSI() - editansi( %xcthîs test%xn, c, y ) - th?s test -- user error, works
EVAL() - eval( thîs test ) - th?s test -- user error, works
GARBLE() - garble( thîs test, 3 ) - th?s test -- user error, works
LCSTR() - lcstr( THÎS TEST ) - th?s test -- user error, works
LJUST() - ljust( thîs test, 3 ) - th?s test -- user error, works
MEDIT() - medit( thîs test, îs, åt ) - th?t test -- user error, works
NOSTR() - '[nostr( thîs test, test )]' - 'th?s ' -- user error, works
PEDIT() - pedit( thîs test, îs, åt ) - th?t test -- user error, works
REPEAT() - repeat( î, 10 ) - ?????????? -- user error, works

================================================================================
== NOT RELEVANT ================================================================

These are functions that don't seem to have anything to do with string 
manipulation on the level we're looking for.

BRACKETS() - NOT RELEVANT
IFELSE() - NOT RELEVANT 
ISDBREF() - NOT RELEVANT
ISDIGIT() - NOT RELEVANT
ISNUM() - NOT RELEVANT
ISOBJID() - NOT RELEVANT
ISSPACE() - NOT RELEVANT
ISTAG() - NOT RELEVANT? - May test if tags can contain UTF8 later.
ISXDIGIT() - NOT RELEVANT

================================================================================
== TOO COMPLEX =================================================================

Functions that would need a considerable amount of testing and/or coding.

COLUMNS() - NOT TESTING - THIS MUST BE INSANE
PARSESTR() - NOT TESTING - THIS MUST BE INSANE
PRINTF() - NOT TESTING - THIS MUST BE INSANE
mrsenile commented 1 year ago

LJUST(), RJUST(), LJC(), RJC(), and CENTER() delt with.

mrsenile commented 11 months ago

CREPLACE() delt with

mrsenile commented 11 months ago

ESCLIST() and ESCAPEX() delt with

mrsenile commented 11 months ago

isword(), isnum(), isalnum(), isalpha(), isint(), isdigit(), islower(), ispunct(), isspace(), isupper(), isxdigit() UTF8 and ANSI aware utf8() and unicode() added and UTF8 and ANSI aware.

mrsenile commented 11 months ago

elementpos() and strlenvis() delt with

mrsenile commented 11 months ago
TR()      -- Key field reversed if DISABLED
AFTER()   -- Key field reversed if DISABLED
BEFORE()  -- Key field reversed if DISABLED
MID()     -- Type field reversed if DISABLED
DELETE()  -- Key field reversed if DISABLED
LEFT()    -- Key field reversed if DISABLED
RIGHT()   -- Key field reversed if DISABLED

They had the help reversed for the keyvalue, this has been fixed

mrsenile commented 11 months ago

I can't reproduce issues with LIT(), please verify

mrsenile commented 11 months ago

notchr(), orchr(), xorchr(), andchr() delt with

mrsenile commented 11 months ago

pos() and totpos() are delt with

thenomain commented 11 months ago

Gone through many of these. Tried to strike thru the ones in the initial info that appear fixed but having problems with strikethru. Added [OK] at the end.

Notes follow:

Please add "See Also" from help strlenvis() to strlen() and visa-versa? Thank you!

Nothing else for now.

mrsenile commented 11 months ago

You forgot the UTF8 flag to pos()

thenomain commented 5 months ago

TO BE ADDED: template()

thenomain commented 5 months ago

Reminder: left(), right(), and mid() still not unicoded.