summaryrefslogtreecommitdiff
path: root/Library/Artifacts/77/77ec011249b08fb17adf2e15a1e2672b
blob: 4b4082f2bb0b5e43f26708e33364c2e02f079af3 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 00 74 f0 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ......t.............2019.3.6f1..
0020 ff ff ff 01 02 00 00 00 0b 04 00 00 00 ff ff 66 9a 86 21 eb 14 35 98 39 dd 34 1d 51 0e c1 f3 42 ...............f..!..5.9.4.Q...B
0040 00 00 00 ed 00 00 00 02 00 00 00 00 00 00 00 37 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 ...............7................
0060 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 ................................
0080 00 00 00 00 00 00 00 01 00 01 00 0d 00 00 00 45 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 ...............E................
00a0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 ...............#................
00c0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 ...............,................
00e0 00 00 00 00 00 00 00 01 00 01 00 35 00 00 00 61 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 ...........5...a................
0100 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 ...............#................
0120 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 ...............,................
0140 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 ...............r................
0160 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 ...............#................
0180 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 ...............,................
01a0 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 ...........H....................
01c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 ...........1...1............@...
01e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 ................................
0200 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 ...........Q...j................
0220 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 4a 00 00 00 ff ff ff ff 0f 00 00 00 00 c0 00 00 00 ...............J................
0240 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 10 00 00 00 00 80 00 00 00 ...........1...1................
0260 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 11 00 00 00 00 00 00 00 00 ................................
0280 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 12 00 00 00 00 80 00 00 00 ...............j................
02a0 00 00 00 00 00 00 00 01 00 04 00 5c 00 00 00 9b 00 00 80 ff ff ff ff 13 00 00 00 00 80 00 00 00 ...........\....................
02c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 72 00 00 00 ff ff ff ff 14 00 00 00 00 80 00 00 00 ...........H...r................
02e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 15 00 00 00 01 40 00 00 00 ...........1...1............@...
0300 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 16 00 00 00 01 00 00 00 00 ................................
0320 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 17 00 00 00 01 00 00 00 00 ...........Q...j................
0340 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 77 00 00 00 ff ff ff ff 18 00 00 00 00 80 00 00 00 ...........H...w................
0360 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 19 00 00 00 01 40 00 00 00 ...........1...1............@...
0380 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1a 00 00 00 01 00 00 00 00 ................................
03a0 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1b 00 00 00 01 00 00 00 00 ...........Q...j................
03c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 80 00 00 00 ff ff ff ff 1c 00 00 00 00 80 00 00 00 ...........H....................
03e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 1d 00 00 00 01 40 00 00 00 ...........1...1............@...
0400 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1e 00 00 00 01 00 00 00 00 ................................
0420 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1f 00 00 00 01 00 00 00 00 ...........Q...j................
0440 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 20 00 00 00 00 00 00 00 00 ...........y....................
0460 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 21 00 00 00 01 00 80 00 00 ...............#.......!........
0480 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 22 00 00 00 01 00 80 00 00 ...............,......."........
04a0 00 00 00 00 00 00 00 01 00 01 00 11 03 00 80 85 00 00 00 ff ff ff ff 23 00 00 00 01 40 08 00 00 .......................#....@...
04c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 24 00 00 00 01 00 08 00 00 ...........1...1.......$........
04e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 25 00 00 00 01 00 08 00 00 .......................%........
0500 00 00 00 00 00 00 00 01 00 03 00 2e 03 00 80 6a 00 00 80 08 00 00 00 26 00 00 00 01 00 08 00 00 ...............j.......&........
0520 00 00 00 00 00 00 00 01 00 01 00 d5 03 00 80 93 00 00 00 ff ff ff ff 27 00 00 00 00 80 00 00 00 .......................'........
0540 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 28 00 00 00 00 c0 00 00 00 ...........1...1.......(........
0560 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 29 00 00 00 00 00 00 00 00 .......................)........
0580 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 2a 00 00 00 00 80 00 00 00 ...............j.......*........
05a0 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b 00 00 80 ff ff ff ff 2b 00 00 00 00 80 00 00 00 ...........H...........+........
05c0 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 00 00 80 ff ff ff ff 2c 00 00 00 01 40 00 00 00 ...........1...1.......,....@...
05e0 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b 03 00 80 04 00 00 00 2d 00 00 00 01 00 00 00 00 .......................-........
0600 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a 00 00 80 01 00 00 00 2e 00 00 00 01 00 00 00 00 ...........Q...j................
0620 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 2f 00 00 00 00 00 00 00 00 ...........y.........../........
0640 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 30 00 00 00 01 00 80 00 00 ...............#.......0........
0660 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 31 00 00 00 01 00 80 00 00 ...............,.......1........
0680 00 00 00 00 00 00 00 01 00 01 00 20 03 00 80 a7 00 00 00 02 00 00 00 32 00 00 00 00 40 00 00 00 .......................2....@...
06a0 00 00 00 00 00 00 00 01 00 01 00 be 02 00 80 b6 00 00 00 0c 00 00 00 33 00 00 00 00 40 00 00 00 .......................3....@...
06c0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 34 00 00 00 01 00 80 00 00 ...............#.......4........
06e0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 35 00 00 00 01 00 80 00 00 ...............,.......5........
0700 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 bb 00 00 00 ff ff ff ff 36 00 00 00 01 80 00 00 00 ...........H...........6........
0720 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 37 00 00 00 01 40 00 00 00 ...........1...1.......7....@...
0740 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 38 00 00 00 01 00 00 00 00 .......................8........
0760 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 39 00 00 00 01 00 00 00 00 ...........Q...j.......9........
0780 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 c6 00 00 00 ff ff ff ff 3a 00 00 00 01 80 00 00 00 ...........H...........:........
07a0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3b 00 00 00 01 40 00 00 00 ...........1...1.......;....@...
07c0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 3c 00 00 00 01 00 00 00 00 .......................<........
07e0 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 3d 00 00 00 01 00 00 00 00 ...........Q...j.......=........
0800 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 d8 00 00 00 ff ff ff ff 3e 00 00 00 01 80 00 00 00 ...........H...........>........
0820 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3f 00 00 00 01 40 00 00 00 ...........1...1.......?....@...
0840 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 40 00 00 00 01 00 00 00 00 .......................@........
0860 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 41 00 00 00 01 00 00 00 00 ...........Q...j.......A........
0880 00 00 00 00 00 00 00 4d 6f 6e 6f 49 6d 70 6f 72 74 65 72 00 50 50 74 72 3c 45 64 69 74 6f 72 45 .......MonoImporter.PPtr<EditorE
08a0 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 50 74 72 xtension>.m_FileID.m_PathID.PPtr
08c0 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 45 78 74 65 72 6e 61 6c 4f 62 6a 65 63 <PrefabInstance>.m_ExternalObjec
08e0 74 73 00 53 6f 75 72 63 65 41 73 73 65 74 49 64 65 6e 74 69 66 69 65 72 00 74 79 70 65 00 61 73 ts.SourceAssetIdentifier.type.as
0900 73 65 6d 62 6c 79 00 6e 61 6d 65 00 6d 5f 55 73 65 64 46 69 6c 65 49 44 73 00 6d 5f 44 65 66 61 sembly.name.m_UsedFileIDs.m_Defa
0920 75 6c 74 52 65 66 65 72 65 6e 63 65 73 00 65 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 69 63 6f ultReferences.executionOrder.ico
0940 6e 00 6d 5f 55 73 65 72 44 61 74 61 00 6d 5f 41 73 73 65 74 42 75 6e 64 6c 65 4e 61 6d 65 00 6d n.m_UserData.m_AssetBundleName.m
0960 5f 41 73 73 65 74 42 75 6e 64 6c 65 56 61 72 69 61 6e 74 00 00 00 00 00 73 00 00 00 00 ff ff a3 _AssetBundleVariant.....s.......
0980 47 f1 d7 dc 8f 5a 35 36 a0 3a 21 40 69 c1 4a 2a 00 00 00 81 00 00 00 05 00 00 00 15 01 00 80 37 G....Z56.:!@i.J*...............7
09a0 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 ................................
09c0 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 45 ...............................E
09e0 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a00 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a20 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 28 00 00 00 61 ...........................(...a
0a40 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a60 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a80 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 ...............................r
0aa0 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0ac0 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0ae0 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab ...........................H....
0b00 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0b20 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0b40 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0b60 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ea ...........................H....
0b80 01 00 80 ff ff ff ff 0f 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0ba0 00 00 80 ff ff ff ff 10 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0bc0 03 00 80 04 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0be0 00 00 80 01 00 00 00 12 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 3d ...............................=
0c00 00 00 00 ff ff ff ff 13 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0c20 00 00 80 ff ff ff ff 14 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ................................
0c40 03 00 80 04 00 00 00 15 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a ...............................j
0c60 00 00 80 ff ff ff ff 16 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b ...........................H....
0c80 00 00 80 ff ff ff ff 17 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 ...........................1...1
0ca0 00 00 80 ff ff ff ff 18 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b ............@...................
0cc0 03 00 80 04 00 00 00 19 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a ...........................Q...j
0ce0 00 00 80 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a ...........................y....
0d00 03 00 80 0c 00 00 00 1b 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 16 ................................
0d20 00 00 00 04 00 00 00 1c 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 1f ................................
0d40 00 00 00 08 00 00 00 1d 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 79 02 00 80 51 ...........................y...Q
0d60 00 00 00 0c 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0d80 00 00 00 04 00 00 00 1f 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0da0 00 00 00 08 00 00 00 20 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 de 00 00 80 58 ...............................X
0dc0 00 00 00 04 00 00 00 21 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 69 .......!...................H...i
0de0 00 00 00 ff ff ff ff 22 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ......."...................1...1
0e00 00 00 80 ff ff ff ff 23 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......#....@...................
0e20 03 00 80 04 00 00 00 24 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......$...................Q...j
0e40 00 00 80 01 00 00 00 25 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 75 .......%...................H...u
0e60 00 00 00 ff ff ff ff 26 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 .......&...................1...1
0e80 00 00 80 ff ff ff ff 27 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......'....@...................
0ea0 03 00 80 04 00 00 00 28 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......(...................Q...j
0ec0 00 00 80 01 00 00 00 29 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 50 50 74 72 3c 45 64 69 74 .......)...............PPtr<Edit
0ee0 6f 72 45 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 orExtension>.m_FileID.m_PathID.P
0f00 50 74 72 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 44 65 66 61 75 6c 74 52 65 66 Ptr<PrefabInstance>.m_DefaultRef
0f20 65 72 65 6e 63 65 73 00 6d 5f 49 63 6f 6e 00 6d 5f 45 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 erences.m_Icon.m_ExecutionOrder.
0f40 6d 5f 43 6c 61 73 73 4e 61 6d 65 00 6d 5f 4e 61 6d 65 73 70 61 63 65 00 00 00 00 00 02 00 00 00 m_ClassName.m_Namespace.........
0f60 03 00 00 00 00 00 00 00 00 00 00 00 5c 00 00 00 00 00 00 00 e0 79 af 00 00 00 00 00 60 00 00 00 ............\........y......`...
0f80 90 64 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .d..............................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 0f 00 00 00 54 65 78 74 45 64 69 74 6f 72 54 65 73 74 73 00 21 64 00 00 ............TextEditorTests.!d..
10a0 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 3b 0a 75 73 69 6e 67 20 using.System.Collections;.using.
10c0 53 79 73 74 65 6d 2e 4c 69 6e 71 3b 0a 75 73 69 6e 67 20 4e 55 6e 69 74 2e 46 72 61 6d 65 77 6f System.Linq;.using.NUnit.Framewo
10e0 72 6b 3b 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 3b 0a 0a 70 75 62 6c 69 63 20 63 rk;.using.UnityEngine;..public.c
1100 6c 61 73 73 20 54 65 78 74 45 64 69 74 6f 72 54 65 73 74 73 0a 7b 0a 20 20 20 20 54 65 78 74 45 lass.TextEditorTests.{.....TextE
1120 64 69 74 6f 72 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 3b 0a 0a 20 20 20 20 73 74 61 74 69 63 20 ditor.m_TextEditor;......static.
1140 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 IEnumerable.textWithCodePointBou
1160 6e 64 61 72 79 49 6e 64 69 63 65 73 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 67 65 74 0a 20 ndaryIndices.....{.........get..
1180 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 .......{.............yield.retur
11a0 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 n.new.TestCaseData("",.new[].{.0
11c0 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 .});.............yield.return.ne
11e0 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 61 62 63 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c w.TestCaseData("abc",.new[].{.0,
1200 20 31 2c 20 32 2c 20 33 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 .1,.2,.3.});.............yield.r
1220 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 5c 55 30 30 30 31 66 36 eturn.new.TestCaseData("\U0001f6
1240 34 32 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 32 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 55 42",.new[].{.0,.2.}).SetName("(U
1260 2b 31 46 36 34 32 29 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 +1F642)");.............yield.ret
1280 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 5c 55 30 30 30 31 66 36 34 32 urn.new.TestCaseData("\U0001f642
12a0 5c 55 30 30 30 31 66 36 34 33 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 32 2c 20 34 20 7d 29 2e \U0001f643",.new[].{.0,.2,.4.}).
12c0 53 65 74 4e 61 6d 65 28 22 28 55 2b 31 46 36 34 32 29 28 55 2b 31 46 36 34 33 29 22 29 3b 0a 20 SetName("(U+1F642)(U+1F643)");..
12e0 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 ...........yield.return.new.Test
1300 43 61 73 65 44 61 74 61 28 22 61 5c 55 30 30 30 31 66 36 34 32 62 5c 55 30 30 30 31 66 36 34 33 CaseData("a\U0001f642b\U0001f643
1320 63 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 33 2c 20 34 2c 20 36 2c 20 37 20 7d 29 2e c",.new[].{.0,.1,.3,.4,.6,.7.}).
1340 53 65 74 4e 61 6d 65 28 22 61 28 55 2b 31 46 36 34 32 29 62 28 55 2b 31 46 36 34 33 29 63 22 29 SetName("a(U+1F642)b(U+1F643)c")
1360 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 ;.............yield.return.new.T
1380 65 73 74 43 61 73 65 44 61 74 61 28 22 48 65 6c 6c 6f 20 f0 9f 98 81 20 57 6f 72 6c 64 22 2c 20 estCaseData("Hello......World",.
13a0 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 32 2c 20 33 2c 20 34 2c 20 35 2c 20 36 2c 20 38 2c 20 new[].{.0,.1,.2,.3,.4,.5,.6,.8,.
13c0 39 2c 20 31 30 2c 20 31 31 2c 20 31 32 2c 20 31 33 2c 20 31 34 20 7d 29 2e 53 65 74 4e 61 6d 65 9,.10,.11,.12,.13,.14.}).SetName
13e0 28 22 48 65 6c 6c 6f 20 28 55 2b 31 46 36 30 31 29 20 57 6f 72 6c 64 22 29 3b 0a 20 20 20 20 20 ("Hello.(U+1F601).World");......
1400 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 .......yield.return.new.TestCase
1420 44 61 74 61 28 22 e8 a6 8b e3 81 96 e3 82 8b f0 9f 99 88 e3 80 81 e8 81 9e e3 81 8b e3 81 96 e3 Data("..........................
1440 82 8b f0 9f 99 89 e3 80 81 e8 a8 80 e3 82 8f e3 81 96 e3 82 8b f0 9f 99 8a 22 2c 20 6e 65 77 5b .........................",.new[
1460 5d 20 7b 20 30 2c 20 31 2c 20 32 2c 20 33 2c 20 35 2c 20 36 2c 20 37 2c 20 38 2c 20 39 2c 20 31 ].{.0,.1,.2,.3,.5,.6,.7,.8,.9,.1
1480 30 2c 20 31 32 2c 20 31 33 2c 20 31 34 2c 20 31 35 2c 20 31 36 2c 20 31 37 2c 20 31 39 20 7d 29 0,.12,.13,.14,.15,.16,.17,.19.})
14a0 2e 53 65 74 4e 61 6d 65 28 22 54 68 72 65 65 20 77 69 73 65 20 6d 6f 6e 6b 65 79 73 22 29 3b 0a .SetName("Three.wise.monkeys");.
14c0 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 73 74 61 74 69 63 20 49 45 6e 75 ........}.....}......static.IEnu
14e0 6d 65 72 61 62 6c 65 20 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 merable.textWithWordStartAndEndI
1500 6e 64 69 63 65 73 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 ndices.....{.........get........
1520 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 .{.............yield.return.new.
1540 54 65 73 74 43 61 73 65 44 61 74 61 28 22 22 2c 20 6e 65 77 20 69 6e 74 5b 30 5d 2c 20 6e 65 77 TestCaseData("",.new.int[0],.new
1560 20 69 6e 74 5b 30 5d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 .int[0]);.............yield.retu
1580 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 20 22 2c 20 6e 65 77 20 69 6e 74 rn.new.TestCaseData(".",.new.int
15a0 5b 30 5d 2c 20 6e 65 77 20 69 6e 74 5b 30 5d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 [0],.new.int[0]);.............yi
15c0 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 6f 6e 65 eld.return.new.TestCaseData("one
15e0 20 74 77 6f 20 74 68 72 65 65 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 34 2c 20 38 20 7d 2c 20 .two.three",.new[].{.0,.4,.8.},.
1600 6e 65 77 5b 5d 20 7b 20 33 2c 20 37 2c 20 31 33 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 new[].{.3,.7,.13.});............
1620 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 .yield.return.new.TestCaseData("
1640 5c 55 30 30 30 31 30 30 30 30 20 5c 55 30 30 30 31 30 30 30 31 20 5c 55 30 30 30 31 30 30 30 32 \U00010000.\U00010001.\U00010002
1660 5c 55 30 30 30 31 30 30 30 33 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 33 2c 20 36 20 7d 2c 20 \U00010003",.new[].{.0,.3,.6.},.
1680 6e 65 77 5b 5d 20 7b 20 32 2c 20 35 2c 20 31 30 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 55 2b new[].{.2,.5,.10.}).SetName("(U+
16a0 31 30 30 30 30 29 20 28 55 2b 31 30 30 30 31 29 20 28 55 2b 31 30 30 30 32 29 28 55 2b 31 30 30 10000).(U+10001).(U+10002)(U+100
16c0 30 33 29 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 03)");.............yield.return.
16e0 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 48 65 6c 6c 6f 20 f0 9f 98 81 20 57 6f 72 new.TestCaseData("Hello......Wor
1700 6c 64 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 36 2c 20 39 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 ld",.new[].{.0,.6,.9.},.new[].{.
1720 35 2c 20 38 2c 20 31 34 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 48 65 6c 6c 6f 20 28 55 2b 31 46 5,.8,.14.}).SetName("Hello.(U+1F
1740 36 30 31 29 20 57 6f 72 6c 64 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 601).World");.............yield.
1760 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 e8 a6 8b e3 81 96 e3 return.new.TestCaseData(".......
1780 82 8b f0 9f 99 88 e3 80 81 e8 81 9e e3 81 8b e3 81 96 e3 82 8b f0 9f 99 89 e3 80 81 e8 a8 80 e3 ................................
17a0 82 8f e3 81 96 e3 82 8b f0 9f 99 8a 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 33 2c 20 36 2c 20 ............",.new[].{.0,.3,.6,.
17c0 31 30 2c 20 31 33 2c 20 31 37 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 33 2c 20 36 2c 20 31 30 2c 20 10,.13,.17.},.new[].{.3,.6,.10,.
17e0 31 33 2c 20 31 37 2c 20 31 39 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 54 68 72 65 65 20 77 69 73 13,.17,.19.}).SetName("Three.wis
1800 65 20 6d 6f 6e 6b 65 79 73 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 e.monkeys");.........}.....}....
1820 20 20 2f 2f 20 41 20 73 65 71 75 65 6e 63 65 73 20 6f 66 20 70 75 6e 63 74 75 61 74 69 6f 6e 20 ..//.A.sequences.of.punctuation.
1840 63 68 61 72 61 63 74 65 72 73 20 69 73 20 63 75 72 72 65 6e 74 6c 79 20 63 6f 6e 73 69 64 65 72 characters.is.currently.consider
1860 65 64 20 61 20 77 6f 72 64 20 77 68 65 6e 20 64 65 6c 65 74 69 6e 67 0a 20 20 20 20 73 74 61 74 ed.a.word.when.deleting.....stat
1880 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 ic.IEnumerable.textWithWordStart
18a0 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 41 AndEndIndicesWherePunctuationIsA
18c0 57 6f 72 64 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 20 7b Word.....{.........get.........{
18e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 .............yield.return.new.Te
1900 73 74 43 61 73 65 44 61 74 61 28 22 20 2c 2e 20 61 62 63 2c 2e 20 22 2c 20 6e 65 77 5b 5d 20 7b stCaseData(".,..abc,..",.new[].{
1920 20 31 2c 20 34 2c 20 37 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 33 2c 20 37 2c 20 39 20 7d 29 3b 0a .1,.4,.7.},.new[].{.3,.7,.9.});.
1940 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 2f 2f 20 62 75 74 20 6e 6f 74 20 ........}.....}......//.but.not.
1960 77 68 65 6e 20 6d 6f 76 69 6e 67 2f 73 65 6c 65 63 74 69 6e 67 0a 20 20 20 20 73 74 61 74 69 63 when.moving/selecting.....static
1980 20 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e .IEnumerable.textWithWordStartAn
19a0 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 4e 6f 74 dEndIndicesWherePunctuationIsNot
19c0 41 57 6f 72 64 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 20 AWord.....{.........get.........
19e0 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 {.............yield.return.new.T
1a00 65 73 74 43 61 73 65 44 61 74 61 28 22 20 2c 2e 20 61 62 63 2c 2e 20 22 2c 20 6e 65 77 5b 5d 20 estCaseData(".,..abc,..",.new[].
1a20 7b 20 34 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 37 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 {.4.},.new[].{.7.});.........}..
1a40 20 20 20 7d 0a 0a 20 20 20 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 78 ...}......static.IEnumerable.tex
1a60 74 57 69 74 68 4c 69 6e 65 53 74 61 72 74 49 6e 64 69 63 65 73 0a 20 20 20 20 7b 0a 20 20 20 20 tWithLineStartIndices.....{.....
1a80 20 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 ....get.........{.............yi
1aa0 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 5c 6e 5c eld.return.new.TestCaseData("\n\
1ac0 6e 61 5c 6e 62 63 5c 6e 5c 55 30 30 30 31 66 36 34 32 5c 6e 5c 55 30 30 30 31 66 36 34 32 5c 55 na\nbc\n\U0001f642\n\U0001f642\U
1ae0 30 30 30 31 66 36 34 33 5c 6e 5c 6e 20 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 32 2c 0001f643\n\n.",.new[].{.0,.1,.2,
1b00 20 34 2c 20 37 2c 20 31 30 2c 20 31 35 2c 20 31 36 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 4c .4,.7,.10,.15,.16.}).SetName("(L
1b20 46 29 28 4c 46 29 61 28 4c 46 29 62 63 28 4c 46 29 28 55 2b 31 46 36 34 32 29 28 4c 46 29 28 55 F)(LF)a(LF)bc(LF)(U+1F642)(LF)(U
1b40 2b 31 46 36 34 32 29 28 55 2b 31 46 36 34 33 29 28 4c 46 29 28 4c 46 29 20 22 29 3b 0a 20 20 20 +1F642)(U+1F643)(LF)(LF).");....
1b60 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 .........yield.return.new.TestCa
1b80 73 65 44 61 74 61 28 22 5c 6e 5c 6e 61 5c 6e 62 63 5c 6e f0 9f 99 82 5c 6e f0 9f 99 82 f0 9f 99 seData("\n\na\nbc\n....\n.......
1ba0 83 5c 6e 5c 6e 20 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 32 2c 20 34 2c 20 37 2c 20 .\n\n.",.new[].{.0,.1,.2,.4,.7,.
1bc0 31 30 2c 20 31 35 2c 20 31 36 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 4c 46 29 28 4c 46 29 61 10,.15,.16.}).SetName("(LF)(LF)a
1be0 28 4c 46 29 62 63 28 4c 46 29 28 55 2b 31 46 36 34 32 29 28 4c 46 29 28 55 2b 31 46 36 34 32 29 (LF)bc(LF)(U+1F642)(LF)(U+1F642)
1c00 28 55 2b 31 46 36 34 33 29 28 4c 46 29 28 4c 46 29 20 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a (U+1F643)(LF)(LF).");.........}.
1c20 20 20 20 20 7d 0a 0a 20 20 20 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 ....}......static.IEnumerable.te
1c40 78 74 57 69 74 68 4c 69 6e 65 45 6e 64 49 6e 64 69 63 65 73 0a 20 20 20 20 7b 0a 20 20 20 20 20 xtWithLineEndIndices.....{......
1c60 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 ...get.........{.............yie
1c80 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 5c 6e 5c 6e ld.return.new.TestCaseData("\n\n
1ca0 61 5c 6e 62 63 5c 6e 5c 55 30 30 30 31 66 36 34 32 5c 6e 5c 55 30 30 30 31 66 36 34 32 5c 55 30 a\nbc\n\U0001f642\n\U0001f642\U0
1cc0 30 30 31 66 36 34 33 5c 6e 5c 6e 20 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 33 2c 20 001f643\n\n.",.new[].{.0,.1,.3,.
1ce0 36 2c 20 39 2c 20 31 34 2c 20 31 35 2c 20 31 37 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 4c 46 6,.9,.14,.15,.17.}).SetName("(LF
1d00 29 28 4c 46 29 61 28 4c 46 29 62 63 28 4c 46 29 28 55 2b 31 46 36 34 32 29 28 4c 46 29 28 55 2b )(LF)a(LF)bc(LF)(U+1F642)(LF)(U+
1d20 31 46 36 34 32 29 28 55 2b 31 46 36 34 33 29 28 4c 46 29 28 4c 46 29 20 22 29 3b 0a 20 20 20 20 1F642)(U+1F643)(LF)(LF).");.....
1d40 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 ........yield.return.new.TestCas
1d60 65 44 61 74 61 28 22 5c 6e 5c 6e 61 5c 6e 62 63 5c 6e f0 9f 99 82 5c 6e f0 9f 99 82 f0 9f 99 83 eData("\n\na\nbc\n....\n........
1d80 5c 6e 5c 6e 20 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 33 2c 20 36 2c 20 39 2c 20 31 \n\n.",.new[].{.0,.1,.3,.6,.9,.1
1da0 34 2c 20 31 35 2c 20 31 37 20 7d 29 2e 53 65 74 4e 61 6d 65 28 22 28 4c 46 29 28 4c 46 29 61 28 4,.15,.17.}).SetName("(LF)(LF)a(
1dc0 4c 46 29 62 63 28 4c 46 29 28 55 2b 31 46 36 34 32 29 28 4c 46 29 28 55 2b 31 46 36 34 32 29 28 LF)bc(LF)(U+1F642)(LF)(U+1F642)(
1de0 55 2b 31 46 36 34 33 29 28 4c 46 29 28 4c 46 29 20 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 U+1F643)(LF)(LF).");.........}..
1e00 20 20 20 7d 0a 0a 20 20 20 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 20 74 65 78 ...}......static.IEnumerable.tex
1e20 74 57 69 74 68 45 78 70 65 63 74 65 64 43 75 72 73 6f 72 41 6e 64 53 65 6c 65 63 74 49 6e 64 69 tWithExpectedCursorAndSelectIndi
1e40 63 65 73 57 68 65 6e 53 65 6c 65 63 74 69 6e 67 43 75 72 72 65 6e 74 57 6f 72 64 41 74 49 6e 64 cesWhenSelectingCurrentWordAtInd
1e60 65 78 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 67 65 74 0a 20 20 20 20 20 20 20 20 7b 0a 20 ex.....{.........get.........{..
1e80 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 ...........yield.return.new.Test
1ea0 43 61 73 65 44 61 74 61 28 22 22 2c 20 6e 65 77 5b 5d 20 7b 20 30 20 7d 2c 20 6e 65 77 5b 5d 20 CaseData("",.new[].{.0.},.new[].
1ec0 7b 20 30 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e {.0.});.............yield.return
1ee0 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 20 22 2c 20 6e 65 77 5b 5d 20 7b 20 31 .new.TestCaseData(".",.new[].{.1
1f00 2c 20 31 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 30 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 ,.1.},.new[].{.0,.0.});.........
1f20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 ....yield.return.new.TestCaseDat
1f40 61 28 22 61 22 2c 20 6e 65 77 5b 5d 20 7b 20 31 2c 20 31 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 30 a("a",.new[].{.1,.1.},.new[].{.0
1f60 2c 20 30 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e ,.0.});.............yield.return
1f80 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 61 62 22 2c 20 6e 65 77 5b 5d 20 7b 20 .new.TestCaseData("ab",.new[].{.
1fa0 32 2c 20 32 2c 20 32 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 30 2c 20 30 20 7d 29 3b 0a 20 2,.2,.2.},.new[].{.0,.0,.0.});..
1fc0 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 ...........yield.return.new.Test
1fe0 43 61 73 65 44 61 74 61 28 22 61 62 20 20 63 64 22 2c 20 6e 65 77 5b 5d 20 7b 20 32 2c 20 32 2c CaseData("ab..cd",.new[].{.2,.2,
2000 20 34 2c 20 34 2c 20 36 2c 20 36 2c 20 36 20 7d 2c 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 30 2c 20 .4,.4,.6,.6,.6.},.new[].{.0,.0,.
2020 32 2c 20 32 2c 20 34 2c 20 34 2c 20 34 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 2,.2,.4,.4,.4.});.............yi
2040 65 6c 64 20 72 65 74 75 72 6e 20 6e 65 77 20 54 65 73 74 43 61 73 65 44 61 74 61 28 22 61 2c 2c eld.return.new.TestCaseData("a,,
2060 20 20 2c 2c 20 20 2c 2c 62 22 2c 20 6e 65 77 5b 5d 20 7b 20 31 2c 20 33 2c 20 33 2c 20 35 2c 20 ..,,..,,b",.new[].{.1,.3,.3,.5,.
2080 35 2c 20 37 2c 20 37 2c 20 39 2c 20 39 2c 20 31 31 2c 20 31 31 2c 20 31 32 2c 20 31 32 20 7d 2c 5,.7,.7,.9,.9,.11,.11,.12,.12.},
20a0 20 6e 65 77 5b 5d 20 7b 20 30 2c 20 31 2c 20 31 2c 20 33 2c 20 33 2c 20 35 2c 20 35 2c 20 37 2c .new[].{.0,.1,.1,.3,.3,.5,.5,.7,
20c0 20 37 2c 20 39 2c 20 39 2c 20 31 31 2c 20 31 31 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 .7,.9,.9,.11,.11.});.........}..
20e0 20 20 20 7d 0a 0a 20 20 20 20 5b 53 65 74 55 70 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 ...}......[SetUp].....public.voi
2100 64 20 54 65 73 74 53 65 74 75 70 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 d.TestSetup().....{.........m_Te
2120 78 74 45 64 69 74 6f 72 20 3d 20 6e 65 77 20 54 65 78 74 45 64 69 74 6f 72 28 29 3b 0a 20 20 20 xtEditor.=.new.TextEditor();....
2140 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 44 65 74 65 63 74 46 6f 63 75 73 43 68 61 .....m_TextEditor.DetectFocusCha
2160 6e 67 65 28 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 nge();.....}......[Test].....pub
2180 6c 69 63 20 76 6f 69 64 20 53 65 74 54 65 78 74 5f 4d 6f 76 65 73 43 75 72 73 6f 72 41 6e 64 53 lic.void.SetText_MovesCursorAndS
21a0 65 6c 65 63 74 49 6e 64 69 63 65 73 54 6f 4e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 electIndicesToNextCodePointIndex
21c0 49 66 49 6e 76 61 6c 69 64 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 IfInvalid().....{.........m_Text
21e0 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 22 61 62 22 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 Editor.text.=."ab";.........m_Te
2200 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 xtEditor.cursorIndex.=.m_TextEdi
2220 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 31 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f tor.selectIndex.=.1;..........m_
2240 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 22 5c 55 30 30 30 31 66 36 34 32 22 3b 0a TextEditor.text.=."\U0001f642";.
2260 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 32 2c 20 6d 5f 54 65 .........Assert.AreEqual(2,.m_Te
2280 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 xtEditor.cursorIndex,."cursorInd
22a0 65 78 20 61 74 20 69 6e 76 61 6c 69 64 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 29 ex.at.invalid.code.point.index")
22c0 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 32 2c 20 6d 5f 54 ;.........Assert.AreEqual(2,.m_T
22e0 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e extEditor.selectIndex,."selectIn
2300 64 65 78 20 61 74 20 69 6e 76 61 6c 69 64 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 dex.at.invalid.code.point.index"
2320 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 );.....}......[Test,.TestCaseSou
2340 72 63 65 28 22 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e rce("textWithCodePointBoundaryIn
2360 64 69 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 43 75 72 73 dices")].....public.void.SetCurs
2380 6f 72 41 6e 64 53 65 6c 65 63 74 49 6e 64 69 63 65 73 5f 4d 6f 76 65 73 54 6f 4e 65 78 74 43 6f orAndSelectIndices_MovesToNextCo
23a0 64 65 50 6f 69 6e 74 49 6e 64 65 78 49 66 49 6e 76 61 6c 69 64 28 73 74 72 69 6e 67 20 74 65 78 dePointIndexIfInvalid(string.tex
23c0 74 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b t,.int[].codePointIndices).....{
23e0 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 .........m_TextEditor.text.=.tex
2400 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 t;..........for.(var.index.=.0;.
2420 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 index.<=.text.Length;.index++)..
2440 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f .......{.............m_TextEdito
2460 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c r.cursorIndex.=.m_TextEditor.sel
2480 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 ectIndex.=.index;..............v
24a0 61 72 20 6e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 20 3d 3d ar.nextCodePointIndex.=.index.==
24c0 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3f 20 69 6e 64 65 78 20 3a 20 63 6f 64 65 50 6f 69 6e 74 .text.Length.?.index.:.codePoint
24e0 49 6e 64 69 63 65 73 2e 46 69 72 73 74 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 20 3d 3e 20 Indices.First(codePointIndex.=>.
2500 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 20 3e 20 69 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 codePointIndex.>.index);........
2520 20 20 20 20 20 69 66 20 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 43 6f 6e 74 61 69 .....if.(codePointIndices.Contai
2540 6e 73 28 69 6e 64 65 78 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 ns(index)).................Asser
2560 74 2e 41 72 65 45 71 75 61 6c 28 69 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 t.AreEqual(index,.m_TextEditor.c
2580 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f ursorIndex,.string.Format("curso
25a0 72 49 6e 64 65 78 20 7b 30 7d 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 20 69 66 20 rIndex.{0}.should.not.change.if.
25c0 69 74 27 73 20 61 6c 72 65 61 64 79 20 61 74 20 61 20 76 61 6c 69 64 20 63 6f 64 65 20 70 6f 69 it's.already.at.a.valid.code.poi
25e0 6e 74 20 69 6e 64 65 78 22 2c 20 69 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 nt.index",.index));.............
2600 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 else.................Assert.AreE
2620 71 75 61 6c 28 6e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 qual(nextCodePointIndex,.m_TextE
2640 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 ditor.cursorIndex,.string.Format
2660 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 ("cursorIndex.{0}.did.not.move.t
2680 6f 20 6e 65 78 74 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 69 6e 64 65 78 29 o.next.code.point.index",.index)
26a0 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 );.............if.(codePointIndi
26c0 63 65 73 2e 43 6f 6e 74 61 69 6e 73 28 69 6e 64 65 78 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 ces.Contains(index))............
26e0 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 69 6e 64 65 78 2c 20 6d 5f 54 65 .....Assert.AreEqual(index,.m_Te
2700 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 xtEditor.selectIndex,.string.For
2720 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 73 68 6f 75 6c 64 20 6e 6f 74 20 mat("selectIndex.{0}.should.not.
2740 63 68 61 6e 67 65 20 69 66 20 69 74 27 73 20 61 6c 72 65 61 64 79 20 61 74 20 61 20 76 61 6c 69 change.if.it's.already.at.a.vali
2760 64 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 69 6e 64 65 78 29 29 3b 0a 20 20 d.code.point.index",.index));...
2780 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 ..........else.................A
27a0 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 6e 64 65 ssert.AreEqual(nextCodePointInde
27c0 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 x,.m_TextEditor.selectIndex,.str
27e0 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 ing.Format("selectIndex.{0}.did.
2800 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6e 65 78 74 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 not.move.to.next.code.point.inde
2820 78 22 2c 20 69 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 x",.index));.........}.....}....
2840 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 ..[Test].....[TestCaseSource("te
2860 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 22 29 5d 0a xtWithWordStartAndEndIndices")].
2880 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 ....[TestCaseSource("textWithWor
28a0 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 dStartAndEndIndicesWherePunctuat
28c0 69 6f 6e 49 73 41 57 6f 72 64 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 65 ionIsAWord")].....public.void.De
28e0 6c 65 74 65 57 6f 72 64 42 61 63 6b 5f 44 65 6c 65 74 65 73 42 61 63 6b 54 6f 50 72 65 76 69 6f leteWordBack_DeletesBackToPrevio
2900 75 73 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 77 usWordStart(string.text,.int[].w
2920 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 45 6e 64 49 6e ordStartIndices,.int[].wordEndIn
2940 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e dices).....{.........for.(var.in
2960 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 dex.=.0;.index.<=.text.Length;.i
2980 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f ndex++).........{.............m_
29a0 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 TextEditor.text.=.text;.........
29c0 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d ....m_TextEditor.cursorIndex.=.m
29e0 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b _TextEditor.selectIndex.=.index;
2a00 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 .............var.oldCursorIndex.
2a20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 =.m_TextEditor.cursorIndex;.....
2a40 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 ........var.oldSelectIndex.=.m_T
2a60 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 extEditor.selectIndex;..........
2a80 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 44 65 6c 65 74 65 57 6f 72 64 42 61 63 6b 28 ....m_TextEditor.DeleteWordBack(
2aa0 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 72 65 76 69 6f 75 73 57 6f 72 64 );..............var.previousWord
2ac0 53 74 61 72 74 20 3d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2e 52 65 76 65 72 73 65 Start.=.wordStartIndices.Reverse
2ae0 28 29 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c 74 28 69 20 3d 3e 20 69 20 3c 20 6f 6c 64 43 75 ().FirstOrDefault(i.=>.i.<.oldCu
2b00 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 rsorIndex);.............Assert.A
2b20 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 78 reEqual(previousWordStart,.m_Tex
2b40 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d tEditor.cursorIndex,.string.Form
2b60 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 at("cursorIndex.{0}.did.not.move
2b80 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 2c 20 6f 6c 64 43 75 72 .to.previous.word.start",.oldCur
2ba0 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 sorIndex));.............Assert.A
2bc0 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 78 reEqual(previousWordStart,.m_Tex
2be0 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d tEditor.selectIndex,.string.Form
2c00 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 at("selectIndex.{0}.did.not.move
2c20 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 2c 20 6f 6c 64 53 65 6c .to.previous.word.start",.oldSel
2c40 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 ectIndex));.............Assert.A
2c60 72 65 45 71 75 61 6c 28 74 65 78 74 2e 52 65 6d 6f 76 65 28 70 72 65 76 69 6f 75 73 57 6f 72 64 reEqual(text.Remove(previousWord
2c80 53 74 61 72 74 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 2d 20 70 72 65 76 69 6f 75 73 Start,.oldCursorIndex.-.previous
2ca0 57 6f 72 64 53 74 61 72 74 29 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 2c 20 73 WordStart),.m_TextEditor.text,.s
2cc0 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 77 72 6f 6e 67 20 72 65 73 75 6c 74 69 6e 67 20 74 65 tring.Format("wrong.resulting.te
2ce0 78 74 20 66 6f 72 20 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 22 2c 20 6f 6c 64 43 75 72 73 xt.for.cursorIndex.{0}",.oldCurs
2d00 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 orIndex));.........}.....}......
2d20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 [Test].....[TestCaseSource("text
2d40 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 WithWordStartAndEndIndices")]...
2d60 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 ..[TestCaseSource("textWithWordS
2d80 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 69 6f tartAndEndIndicesWherePunctuatio
2da0 6e 49 73 41 57 6f 72 64 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 65 6c 65 nIsAWord")].....public.void.Dele
2dc0 74 65 57 6f 72 64 46 6f 72 77 61 72 64 5f 44 65 6c 65 74 65 73 46 6f 72 77 61 72 64 54 6f 4e 65 teWordForward_DeletesForwardToNe
2de0 78 74 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 77 xtWordStart(string.text,.int[].w
2e00 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 45 6e 64 49 6e ordStartIndices,.int[].wordEndIn
2e20 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e dices).....{.........for.(var.in
2e40 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 dex.=.0;.index.<=.text.Length;.i
2e60 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f ndex++).........{.............m_
2e80 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 TextEditor.text.=.text;.........
2ea0 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d ....m_TextEditor.cursorIndex.=.m
2ec0 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b _TextEditor.selectIndex.=.index;
2ee0 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 .............var.oldCursorIndex.
2f00 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 =.m_TextEditor.cursorIndex;.....
2f20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 ........var.oldSelectIndex.=.m_T
2f40 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 extEditor.selectIndex;..........
2f60 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 44 65 6c 65 74 65 57 6f 72 64 46 6f 72 77 61 ....m_TextEditor.DeleteWordForwa
2f80 72 64 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 78 74 57 6f 72 64 53 rd();..............var.nextWordS
2fa0 74 61 72 74 20 3d 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d 3d 20 74 65 78 74 2e 4c 65 tart.=.oldCursorIndex.==.text.Le
2fc0 6e 67 74 68 20 3f 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3a 20 77 6f 72 64 53 74 61 72 74 49 6e ngth.?.text.Length.:.wordStartIn
2fe0 64 69 63 65 73 2e 43 6f 6e 63 61 74 28 6e 65 77 5b 5d 20 7b 20 74 65 78 74 2e 4c 65 6e 67 74 68 dices.Concat(new[].{.text.Length
3000 20 7d 29 2e 46 69 72 73 74 28 69 20 3d 3e 20 69 20 3e 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 .}).First(i.=>.i.>.oldCursorInde
3020 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 x);.............Assert.AreEqual(
3040 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 oldCursorIndex,.m_TextEditor.cur
3060 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f 72 49 sorIndex,.string.Format("cursorI
3080 6e 64 65 78 20 7b 30 7d 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 2c 20 6f 6c 64 ndex.{0}.should.not.change",.old
30a0 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 CursorIndex));.............Asser
30c0 74 2e 41 72 65 45 71 75 61 6c 28 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 2c 20 6d 5f 54 65 78 t.AreEqual(oldSelectIndex,.m_Tex
30e0 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d tEditor.selectIndex,.string.Form
3100 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 at("selectIndex.{0}.should.not.c
3120 68 61 6e 67 65 22 2c 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 hange",.oldSelectIndex));.......
3140 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 52 65 6d 6f 76 ......Assert.AreEqual(text.Remov
3160 65 28 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 2c 20 6e 65 78 74 57 6f 72 64 53 74 61 72 74 20 e(oldCursorIndex,.nextWordStart.
3180 2d 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e -.oldCursorIndex),.m_TextEditor.
31a0 74 65 78 74 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 77 72 6f 6e 67 20 72 65 73 75 6c text,.string.Format("wrong.resul
31c0 74 69 6e 67 20 74 65 78 74 20 66 6f 72 20 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 22 2c 20 ting.text.for.cursorIndex.{0}",.
31e0 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 oldCursorIndex));.........}.....
3200 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 }......[Test,.TestCaseSource("te
3220 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 63 65 73 22 29 xtWithCodePointBoundaryIndices")
3240 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 44 65 6c 65 74 65 5f 52 65 6d 6f 76 65 73 ].....public.void.Delete_Removes
3260 43 6f 64 65 50 6f 69 6e 74 52 69 67 68 74 4f 66 43 75 72 73 6f 72 28 73 74 72 69 6e 67 20 74 65 CodePointRightOfCursor(string.te
3280 78 74 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 xt,.int[].codePointIndices).....
32a0 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f {.........for.(var.i.=.0;.i.<.co
32c0 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 4c 65 6e 67 74 68 3b 20 69 2b 2b 29 0a 20 20 20 20 dePointIndices.Length;.i++).....
32e0 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 64 65 50 6f 69 6e 74 49 ....{.............var.codePointI
3300 6e 64 65 78 20 3d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 5b 69 5d 3b 0a 20 20 20 20 ndex.=.codePointIndices[i];.....
3320 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 ........m_TextEditor.text.=.text
3340 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f ;.............m_TextEditor.curso
3360 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 rIndex.=.m_TextEditor.selectInde
3380 78 20 3d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 x.=.codePointIndex;.............
33a0 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 44 65 6c 65 74 65 28 29 3b 0a 0a 20 20 20 20 20 20 20 .m_TextEditor.Delete();.........
33c0 20 20 20 20 20 76 61 72 20 6e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 20 3d 20 69 20 .....var.nextCodePointIndex.=.i.
33e0 3c 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 4c 65 6e 67 74 68 20 2d 20 31 20 3f 20 <.codePointIndices.Length.-.1.?.
3400 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 5b 69 20 2b 20 31 5d 20 3a 20 63 6f 64 65 50 6f codePointIndices[i.+.1].:.codePo
3420 69 6e 74 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 intIndex;.............Assert.Are
3440 45 71 75 61 6c 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 Equal(codePointIndex,.m_TextEdit
3460 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 65 78 20 73 68 6f or.cursorIndex,."cursorIndex.sho
3480 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 uld.not.change");.............As
34a0 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 2c 20 6d 5f sert.AreEqual(codePointIndex,.m_
34c0 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 TextEditor.selectIndex,."selectI
34e0 6e 64 65 78 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 ndex.should.not.change");.......
3500 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 52 65 6d 6f 76 ......Assert.AreEqual(text.Remov
3520 65 28 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 2c 20 6e 65 78 74 43 6f 64 65 50 6f 69 6e 74 49 e(codePointIndex,.nextCodePointI
3540 6e 64 65 78 20 2d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 29 2c 20 6d 5f 54 65 78 74 45 64 ndex.-.codePointIndex),.m_TextEd
3560 69 74 6f 72 2e 74 65 78 74 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 77 72 6f 6e 67 20 itor.text,.string.Format("wrong.
3580 72 65 73 75 6c 74 69 6e 67 20 74 65 78 74 20 66 6f 72 20 63 75 72 73 6f 72 49 6e 64 65 78 20 7b resulting.text.for.cursorIndex.{
35a0 30 7d 22 2c 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0}",.codePointIndex));.........}
35c0 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 .....}......[Test,.TestCaseSourc
35e0 65 28 22 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 e("textWithCodePointBoundaryIndi
3600 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 42 61 63 6b 73 70 61 63 65 ces")].....public.void.Backspace
3620 5f 52 65 6d 6f 76 65 73 43 6f 64 65 50 6f 69 6e 74 4c 65 66 74 4f 66 43 75 72 73 6f 72 28 73 74 _RemovesCodePointLeftOfCursor(st
3640 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 ring.text,.int[].codePointIndice
3660 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 63 6f s).....{.........for.(var.i.=.co
3680 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 4c 65 6e 67 74 68 20 2d 20 31 3b 20 69 20 3e 3d 20 dePointIndices.Length.-.1;.i.>=.
36a0 30 3b 20 69 2d 2d 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 0;.i--).........{.............va
36c0 72 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 20 3d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 r.codePointIndex.=.codePointIndi
36e0 63 65 73 5b 69 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 ces[i];.............m_TextEditor
3700 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 .text.=.text;.............m_Text
3720 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f Editor.cursorIndex.=.m_TextEdito
3740 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 3b 0a r.selectIndex.=.codePointIndex;.
3760 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d ............var.oldCursorIndex.=
3780 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 .m_TextEditor.cursorIndex;......
37a0 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 .......var.oldSelectIndex.=.m_Te
37c0 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 xtEditor.selectIndex;...........
37e0 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 42 61 63 6b 73 70 61 63 65 28 29 3b 0a 0a 20 20 ...m_TextEditor.Backspace();....
3800 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 72 65 76 69 6f 75 73 43 6f 64 65 50 6f 69 6e 74 49 ..........var.previousCodePointI
3820 6e 64 65 78 20 3d 20 69 20 3e 20 30 20 3f 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 5b ndex.=.i.>.0.?.codePointIndices[
3840 69 20 2d 20 31 5d 20 3a 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 i.-.1].:.codePointIndex;........
3860 20 20 20 20 20 76 61 72 20 63 6f 64 65 50 6f 69 6e 74 4c 65 6e 67 74 68 20 3d 20 63 6f 64 65 50 .....var.codePointLength.=.codeP
3880 6f 69 6e 74 49 6e 64 65 78 20 2d 20 70 72 65 76 69 6f 75 73 43 6f 64 65 50 6f 69 6e 74 49 6e 64 ointIndex.-.previousCodePointInd
38a0 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 ex;.............Assert.AreEqual(
38c0 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 2d 20 63 6f 64 65 50 6f 69 6e 74 4c 65 6e 67 74 68 oldCursorIndex.-.codePointLength
38e0 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 ,.m_TextEditor.cursorIndex,.stri
3900 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e ng.Format("cursorIndex.{0}.did.n
3920 6f 74 20 6d 6f 76 65 20 74 6f 20 62 65 66 6f 72 65 20 72 65 6d 6f 76 65 64 20 63 6f 64 65 20 70 ot.move.to.before.removed.code.p
3940 6f 69 6e 74 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 oint",.oldCursorIndex));........
3960 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6f 6c 64 53 65 6c 65 63 74 49 6e .....Assert.AreEqual(oldSelectIn
3980 64 65 78 20 2d 20 63 6f 64 65 50 6f 69 6e 74 4c 65 6e 67 74 68 2c 20 6d 5f 54 65 78 74 45 64 69 dex.-.codePointLength,.m_TextEdi
39a0 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 tor.selectIndex,.string.Format("
39c0 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 selectIndex.{0}.did.not.move.to.
39e0 62 65 66 6f 72 65 20 72 65 6d 6f 76 65 64 20 63 6f 64 65 20 70 6f 69 6e 74 22 2c 20 6f 6c 64 53 before.removed.code.point",.oldS
3a00 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 electIndex));.............Assert
3a20 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 52 65 6d 6f 76 65 28 70 72 65 76 69 6f 75 73 43 6f .AreEqual(text.Remove(previousCo
3a40 64 65 50 6f 69 6e 74 49 6e 64 65 78 2c 20 63 6f 64 65 50 6f 69 6e 74 4c 65 6e 67 74 68 29 2c 20 dePointIndex,.codePointLength),.
3a60 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 m_TextEditor.text);.........}...
3a80 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 ..}......[Test,.TestCaseSource("
3aa0 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 63 65 73 textWithCodePointBoundaryIndices
3ac0 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 52 69 67 68 74 5f 53 6b ")].....public.void.MoveRight_Sk
3ae0 69 70 73 49 6e 76 61 6c 69 64 43 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 28 73 74 72 69 6e ipsInvalidCodePointIndices(strin
3b00 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 29 0a g.text,.int[].codePointIndices).
3b20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 ....{.........m_TextEditor.text.
3b40 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 =.text;.........m_TextEditor.cur
3b60 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e sorIndex.=.m_TextEditor.selectIn
3b80 64 65 78 20 3d 20 30 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 65 dex.=.0;..........foreach.(var.e
3ba0 78 70 65 63 74 65 64 49 6e 64 65 78 20 69 6e 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 xpectedIndex.in.codePointIndices
3bc0 2e 53 6b 69 70 28 31 29 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 .Skip(1)).........{.............
3be0 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f var.oldCursorIndex.=.m_TextEdito
3c00 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f r.cursorIndex;.............var.o
3c20 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c ldSelectIndex.=.m_TextEditor.sel
3c40 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 ectIndex;..............m_TextEdi
3c60 74 6f 72 2e 4d 6f 76 65 52 69 67 68 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 tor.MoveRight();..............As
3c80 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 49 6e 64 65 78 2c 20 6d 5f 54 sert.AreEqual(expectedIndex,.m_T
3ca0 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f extEditor.cursorIndex,.string.Fo
3cc0 72 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f rmat("cursorIndex.{0}.did.not.mo
3ce0 76 65 20 74 6f 20 6e 65 78 74 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 6f 6c ve.to.next.code.point.index",.ol
3d00 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 dCursorIndex));.............Asse
3d20 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 49 6e 64 65 78 2c 20 6d 5f 54 65 78 rt.AreEqual(expectedIndex,.m_Tex
3d40 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d tEditor.selectIndex,.string.Form
3d60 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 at("selectIndex.{0}.did.not.move
3d80 20 74 6f 20 6e 65 78 74 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 6f 6c 64 53 .to.next.code.point.index",.oldS
3da0 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 electIndex));.........}.........
3dc0 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 4c 65 6e 67 74 68 2c 20 6d 5f .Assert.AreEqual(text.Length,.m_
3de0 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 TextEditor.cursorIndex,."cursorI
3e00 6e 64 65 78 20 64 69 64 20 6e 6f 74 20 72 65 61 63 68 20 65 6e 64 22 29 3b 0a 20 20 20 20 20 20 ndex.did.not.reach.end");.......
3e20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 4c 65 6e 67 74 68 2c 20 6d ..Assert.AreEqual(text.Length,.m
3e40 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 _TextEditor.selectIndex,."select
3e60 49 6e 64 65 78 20 64 69 64 20 6e 6f 74 20 72 65 61 63 68 20 65 6e 64 22 29 3b 0a 0a 20 20 20 20 Index.did.not.reach.end");......
3e80 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 52 69 67 68 74 28 29 3b 0a 0a 20 ....m_TextEditor.MoveRight();...
3ea0 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 4c 65 6e 67 .......Assert.AreEqual(text.Leng
3ec0 74 68 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 th,.m_TextEditor.cursorIndex,."c
3ee0 75 72 73 6f 72 49 6e 64 65 78 20 61 74 20 65 6e 64 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 ursorIndex.at.end.should.not.cha
3f00 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 nge");.........Assert.AreEqual(t
3f20 65 78 74 2e 4c 65 6e 67 74 68 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 ext.Length,.m_TextEditor.selectI
3f40 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 20 61 74 20 65 6e 64 20 73 68 6f 75 6c 64 ndex,."selectIndex.at.end.should
3f60 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c .not.change");.....}......[Test,
3f80 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 .TestCaseSource("textWithCodePoi
3fa0 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 ntBoundaryIndices")].....public.
3fc0 76 6f 69 64 20 4d 6f 76 65 4c 65 66 74 5f 53 6b 69 70 73 49 6e 76 61 6c 69 64 43 6f 64 65 50 6f void.MoveLeft_SkipsInvalidCodePo
3fe0 69 6e 74 49 6e 64 69 63 65 73 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 63 6f intIndices(string.text,.int[].co
4000 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f dePointIndices).....{.........m_
4020 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 TextEditor.text.=.text;.........
4040 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 m_TextEditor.cursorIndex.=.m_Tex
4060 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 74 65 78 74 2e 4c 65 6e 67 74 tEditor.selectIndex.=.text.Lengt
4080 68 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 65 78 70 65 63 74 65 h;..........foreach.(var.expecte
40a0 64 49 6e 64 65 78 20 69 6e 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 52 65 76 65 72 dIndex.in.codePointIndices.Rever
40c0 73 65 28 29 2e 53 6b 69 70 28 31 29 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 se().Skip(1)).........{.........
40e0 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 ....var.oldCursorIndex.=.m_TextE
4100 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 ditor.cursorIndex;.............v
4120 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 ar.oldSelectIndex.=.m_TextEditor
4140 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 .selectIndex;..............m_Tex
4160 74 45 64 69 74 6f 72 2e 4d 6f 76 65 4c 65 66 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 tEditor.MoveLeft();.............
4180 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 49 6e 64 65 78 2c 20 .Assert.AreEqual(expectedIndex,.
41a0 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 m_TextEditor.cursorIndex,.string
41c0 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 .Format("cursorIndex.{0}.did.not
41e0 20 6d 6f 76 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 .move.to.previous.code.point.ind
4200 65 78 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 ex",.oldCursorIndex));..........
4220 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 49 6e 64 65 78 ...Assert.AreEqual(expectedIndex
4240 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 ,.m_TextEditor.selectIndex,.stri
4260 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e ng.Format("selectIndex.{0}.did.n
4280 6f 74 20 6d 6f 76 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 ot.move.to.previous.code.point.i
42a0 6e 64 65 78 22 2c 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 ndex",.oldSelectIndex));........
42c0 20 7d 0a 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d .}..........Assert.AreEqual(0,.m
42e0 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 _TextEditor.cursorIndex,."cursor
4300 49 6e 64 65 78 20 64 69 64 20 6e 6f 74 20 72 65 61 63 68 20 73 74 61 72 74 22 29 3b 0a 20 20 20 Index.did.not.reach.start");....
4320 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 74 45 64 .....Assert.AreEqual(0,.m_TextEd
4340 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 20 64 itor.selectIndex,."selectIndex.d
4360 69 64 20 6e 6f 74 20 72 65 61 63 68 20 73 74 61 72 74 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 6d id.not.reach.start");..........m
4380 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 4c 65 66 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 _TextEditor.MoveLeft();.........
43a0 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 .Assert.AreEqual(0,.m_TextEditor
43c0 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 65 78 20 61 74 20 73 74 .cursorIndex,."cursorIndex.at.st
43e0 61 72 74 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 20 art.should.not.change");........
4400 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 .Assert.AreEqual(0,.m_TextEditor
4420 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 20 61 74 20 73 74 .selectIndex,."selectIndex.at.st
4440 61 72 74 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 7d 0a 0a art.should.not.change");.....}..
4460 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 ....[Test,.TestCaseSource("textW
4480 69 74 68 4c 69 6e 65 53 74 61 72 74 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 ithLineStartIndices")].....publi
44a0 63 20 76 6f 69 64 20 4d 6f 76 65 4c 69 6e 65 53 74 61 72 74 5f 4d 6f 76 65 73 43 75 72 73 6f 72 c.void.MoveLineStart_MovesCursor
44c0 41 66 74 65 72 50 72 65 76 69 6f 75 73 4c 69 6e 65 46 65 65 64 28 73 74 72 69 6e 67 20 74 65 78 AfterPreviousLineFeed(string.tex
44e0 74 2c 20 69 6e 74 5b 5d 20 6c 69 6e 65 53 74 61 72 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b t,.int[].lineStartIndices).....{
4500 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 .........m_TextEditor.text.=.tex
4520 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 t;..........for.(var.index.=.0;.
4540 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 index.<=.text.Length;.index++)..
4560 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f .......{.............m_TextEdito
4580 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c r.cursorIndex.=.m_TextEditor.sel
45a0 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 ectIndex.=.index;.............va
45c0 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e r.oldCursorIndex.=.m_TextEditor.
45e0 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 cursorIndex;.............var.old
4600 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 SelectIndex.=.m_TextEditor.selec
4620 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f tIndex;..............m_TextEdito
4640 72 2e 4d 6f 76 65 4c 69 6e 65 53 74 61 72 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 r.MoveLineStart();..............
4660 76 61 72 20 6c 69 6e 65 53 74 61 72 74 20 3d 20 6c 69 6e 65 53 74 61 72 74 49 6e 64 69 63 65 73 var.lineStart.=.lineStartIndices
4680 2e 52 65 76 65 72 73 65 28 29 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c 74 28 69 20 3d 3e 20 69 .Reverse().FirstOrDefault(i.=>.i
46a0 20 3c 3d 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 .<=.oldCursorIndex);............
46c0 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6c 69 6e 65 53 74 61 72 74 2c 20 6d 5f 54 65 .Assert.AreEqual(lineStart,.m_Te
46e0 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 xtEditor.cursorIndex,.string.For
4700 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 mat("cursorIndex.{0}.did.not.mov
4720 65 20 74 6f 20 6c 69 6e 65 20 73 74 61 72 74 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 e.to.line.start",.oldCursorIndex
4740 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 ));.............Assert.AreEqual(
4760 6c 69 6e 65 53 74 61 72 74 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e lineStart,.m_TextEditor.selectIn
4780 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 dex,.string.Format("selectIndex.
47a0 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6c 69 6e 65 20 73 74 61 72 74 22 2c {0}.did.not.move.to.line.start",
47c0 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 .oldSelectIndex));.........}....
47e0 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 .}......[Test,.TestCaseSource("t
4800 65 78 74 57 69 74 68 4c 69 6e 65 45 6e 64 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 extWithLineEndIndices")].....pub
4820 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 4c 69 6e 65 45 6e 64 5f 4d 6f 76 65 73 43 75 72 73 6f 72 lic.void.MoveLineEnd_MovesCursor
4840 42 65 66 6f 72 65 4e 65 78 74 4c 69 6e 65 46 65 65 64 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 BeforeNextLineFeed(string.text,.
4860 69 6e 74 5b 5d 20 6c 69 6e 65 45 6e 64 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 int[].lineEndIndices).....{.....
4880 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 ....m_TextEditor.text.=.text;...
48a0 20 20 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 .......for.(var.index.=.0;.index
48c0 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 .<=.text.Length;.index++).......
48e0 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 ..{.............m_TextEditor.cur
4900 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e sorIndex.=.m_TextEditor.selectIn
4920 64 65 78 20 3d 20 69 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 dex.=.index;.............var.old
4940 43 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f CursorIndex.=.m_TextEditor.curso
4960 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 rIndex;.............var.oldSelec
4980 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 tIndex.=.m_TextEditor.selectInde
49a0 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 x;..............m_TextEditor.Mov
49c0 65 4c 69 6e 65 45 6e 64 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 69 6e eLineEnd();..............var.lin
49e0 65 45 6e 64 20 3d 20 6c 69 6e 65 45 6e 64 49 6e 64 69 63 65 73 2e 46 69 72 73 74 28 69 20 3d 3e eEnd.=.lineEndIndices.First(i.=>
4a00 20 69 20 3e 3d 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 .i.>=.oldCursorIndex);..........
4a20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6c 69 6e 65 45 6e 64 2c 20 6d 5f 54 65 ...Assert.AreEqual(lineEnd,.m_Te
4a40 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 xtEditor.cursorIndex,.string.For
4a60 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 mat("cursorIndex.{0}.did.not.mov
4a80 65 20 74 6f 20 6c 69 6e 65 20 65 6e 64 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 e.to.line.end",.oldCursorIndex))
4aa0 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6c 69 ;.............Assert.AreEqual(li
4ac0 6e 65 45 6e 64 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c neEnd,.m_TextEditor.selectIndex,
4ae0 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 .string.Format("selectIndex.{0}.
4b00 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6c 69 6e 65 20 65 6e 64 22 2c 20 6f 6c 64 53 65 did.not.move.to.line.end",.oldSe
4b20 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 lectIndex));.........}.....}....
4b40 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 54 65 78 ..[Test].....public.void.MoveTex
4b60 74 53 74 61 72 74 5f 4d 6f 76 65 73 43 75 72 73 6f 72 54 6f 53 74 61 72 74 4f 66 54 65 78 74 28 tStart_MovesCursorToStartOfText(
4b80 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 ).....{.........m_TextEditor.tex
4ba0 74 20 3d 20 22 48 65 6c 6c 6f 20 57 6f 72 6c 64 22 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 t.=."Hello.World";.........m_Tex
4bc0 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 tEditor.cursorIndex.=.m_TextEdit
4be0 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 35 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 or.selectIndex.=.5;..........m_T
4c00 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 54 65 78 74 53 74 61 72 74 28 29 3b 0a 0a 20 20 20 20 extEditor.MoveTextStart();......
4c20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 74 45 64 69 ....Assert.AreEqual(0,.m_TextEdi
4c40 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 65 78 20 64 69 tor.cursorIndex,."cursorIndex.di
4c60 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 73 74 61 72 74 20 6f 66 20 74 65 78 74 22 29 3b 0a 20 d.not.move.to.start.of.text");..
4c80 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 74 .......Assert.AreEqual(0,.m_Text
4ca0 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 Editor.selectIndex,."selectIndex
4cc0 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 73 74 61 72 74 20 6f 66 20 74 65 78 74 22 29 .did.not.move.to.start.of.text")
4ce0 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 ;.....}......[Test].....public.v
4d00 6f 69 64 20 4d 6f 76 65 54 65 78 74 45 6e 64 5f 4d 6f 76 65 73 43 75 72 73 6f 72 54 6f 45 6e 64 oid.MoveTextEnd_MovesCursorToEnd
4d20 4f 66 54 65 78 74 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 OfText().....{.........m_TextEdi
4d40 74 6f 72 2e 74 65 78 74 20 3d 20 22 48 65 6c 6c 6f 20 57 6f 72 6c 64 22 3b 0a 20 20 20 20 20 20 tor.text.=."Hello.World";.......
4d60 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 ..m_TextEditor.cursorIndex.=.m_T
4d80 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 35 3b 0a 0a 20 20 20 20 extEditor.selectIndex.=.5;......
4da0 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 54 65 78 74 45 6e 64 28 29 3b 0a ....m_TextEditor.MoveTextEnd();.
4dc0 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6d 5f 54 65 78 74 45 .........Assert.AreEqual(m_TextE
4de0 64 69 74 6f 72 2e 74 65 78 74 2e 4c 65 6e 67 74 68 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e ditor.text.Length,.m_TextEditor.
4e00 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 65 78 20 64 69 64 20 6e 6f cursorIndex,."cursorIndex.did.no
4e20 74 20 6d 6f 76 65 20 74 6f 20 65 6e 64 20 6f 66 20 74 65 78 74 22 29 3b 0a 20 20 20 20 20 20 20 t.move.to.end.of.text");........
4e40 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 .Assert.AreEqual(m_TextEditor.te
4e60 78 74 2e 4c 65 6e 67 74 68 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e xt.Length,.m_TextEditor.selectIn
4e80 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 dex,."selectIndex.did.not.move.t
4ea0 6f 20 65 6e 64 20 6f 66 20 74 65 78 74 22 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 o.end.of.text");.....}......[Tes
4ec0 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 43 6f 64 65 50 t,.TestCaseSource("textWithCodeP
4ee0 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 ointBoundaryIndices")].....publi
4f00 63 20 76 6f 69 64 20 53 65 6c 65 63 74 4c 65 66 74 5f 45 78 70 61 6e 64 53 65 6c 65 63 74 69 6f c.void.SelectLeft_ExpandSelectio
4f20 6e 54 6f 50 72 65 76 69 6f 75 73 43 6f 64 65 50 6f 69 6e 74 28 73 74 72 69 6e 67 20 74 65 78 74 nToPreviousCodePoint(string.text
4f40 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a ,.int[].codePointIndices).....{.
4f60 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 ........m_TextEditor.text.=.text
4f80 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 ;.........m_TextEditor.cursorInd
4fa0 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 ex.=.m_TextEditor.selectIndex.=.
4fc0 74 65 78 74 2e 4c 65 6e 67 74 68 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 text.Length;..........foreach.(v
4fe0 61 72 20 65 78 70 65 63 74 65 64 43 75 72 73 6f 72 49 6e 64 65 78 20 69 6e 20 63 6f 64 65 50 6f ar.expectedCursorIndex.in.codePo
5000 69 6e 74 49 6e 64 69 63 65 73 2e 52 65 76 65 72 73 65 28 29 2e 53 6b 69 70 28 31 29 29 0a 20 20 intIndices.Reverse().Skip(1))...
5020 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f ......{.............var.oldCurso
5040 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 rIndex.=.m_TextEditor.cursorInde
5060 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 x;.............var.oldSelectInde
5080 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 x.=.m_TextEditor.selectIndex;...
50a0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 4c 65 ...........m_TextEditor.SelectLe
50c0 66 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 ft();..............Assert.AreEqu
50e0 61 6c 28 65 78 70 65 63 74 65 64 43 75 72 73 6f 72 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 al(expectedCursorIndex,.m_TextEd
5100 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 itor.cursorIndex,.string.Format(
5120 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f "cursorIndex.{0}.did.not.move.to
5140 20 70 72 65 76 69 6f 75 73 20 63 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 6f 6c 64 .previous.code.point.index",.old
5160 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 CursorIndex));.............Asser
5180 74 2e 41 72 65 45 71 75 61 6c 28 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 2c 20 6d 5f 54 65 78 t.AreEqual(oldSelectIndex,.m_Tex
51a0 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 tEditor.selectIndex,."selectInde
51c0 78 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 20 20 7d x.should.not.change");.........}
51e0 0a 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 ..........Assert.AreEqual(0,.m_T
5200 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e extEditor.cursorIndex,."cursorIn
5220 64 65 78 20 64 69 64 20 6e 6f 74 20 72 65 61 63 68 20 73 74 61 72 74 22 29 3b 0a 0a 20 20 20 20 dex.did.not.reach.start");......
5240 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 4c 65 66 74 28 29 3b 0a 0a ....m_TextEditor.SelectLeft();..
5260 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c 20 6d 5f 54 65 78 ........Assert.AreEqual(0,.m_Tex
5280 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 65 tEditor.cursorIndex,."cursorInde
52a0 78 20 61 74 20 73 74 61 72 74 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65 22 29 3b 0a x.at.start.should.not.change");.
52c0 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 ....}......[Test,.TestCaseSource
52e0 28 22 74 65 78 74 57 69 74 68 43 6f 64 65 50 6f 69 6e 74 42 6f 75 6e 64 61 72 79 49 6e 64 69 63 ("textWithCodePointBoundaryIndic
5300 65 73 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 6c 65 63 74 52 69 67 68 es")].....public.void.SelectRigh
5320 74 5f 45 78 70 61 6e 64 53 65 6c 65 63 74 69 6f 6e 54 6f 4e 65 78 74 43 6f 64 65 50 6f 69 6e 74 t_ExpandSelectionToNextCodePoint
5340 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 63 6f 64 65 50 6f 69 6e 74 49 6e 64 (string.text,.int[].codePointInd
5360 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 ices).....{.........m_TextEditor
5380 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 .text.=.text;.........m_TextEdit
53a0 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 or.cursorIndex.=.m_TextEditor.se
53c0 6c 65 63 74 49 6e 64 65 78 20 3d 20 30 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 lectIndex.=.0;..........foreach.
53e0 28 76 61 72 20 65 78 70 65 63 74 65 64 43 75 72 73 6f 72 49 6e 64 65 78 20 69 6e 20 63 6f 64 65 (var.expectedCursorIndex.in.code
5400 50 6f 69 6e 74 49 6e 64 69 63 65 73 2e 53 6b 69 70 28 31 29 29 0a 20 20 20 20 20 20 20 20 7b 0a PointIndices.Skip(1)).........{.
5420 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d ............var.oldCursorIndex.=
5440 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 .m_TextEditor.cursorIndex;......
5460 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 .......var.oldSelectIndex.=.m_Te
5480 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 xtEditor.selectIndex;...........
54a0 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 52 69 67 68 74 28 29 3b 0a 0a ...m_TextEditor.SelectRight();..
54c0 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 ............Assert.AreEqual(expe
54e0 63 74 65 64 43 75 72 73 6f 72 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 ctedCursorIndex,.m_TextEditor.cu
5500 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f 72 rsorIndex,.string.Format("cursor
5520 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6e 65 78 74 20 63 Index.{0}.did.not.move.to.next.c
5540 6f 64 65 20 70 6f 69 6e 74 20 69 6e 64 65 78 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 ode.point.index",.oldCursorIndex
5560 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 ));.............Assert.AreEqual(
5580 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c oldSelectIndex,.m_TextEditor.sel
55a0 65 63 74 49 6e 64 65 78 2c 20 22 73 65 6c 65 63 74 49 6e 64 65 78 20 73 68 6f 75 6c 64 20 6e 6f ectIndex,."selectIndex.should.no
55c0 74 20 63 68 61 6e 67 65 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 41 t.change");.........}..........A
55e0 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 4c 65 6e 67 74 68 2c 20 6d 5f 54 65 ssert.AreEqual(text.Length,.m_Te
5600 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 72 73 6f 72 49 6e 64 xtEditor.cursorIndex,."cursorInd
5620 65 78 20 64 69 64 20 6e 6f 74 20 72 65 61 63 68 20 65 6e 64 22 29 3b 0a 0a 20 20 20 20 20 20 20 ex.did.not.reach.end");.........
5640 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 52 69 67 68 74 28 29 3b 0a 0a 20 20 .m_TextEditor.SelectRight();....
5660 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 74 65 78 74 2e 4c 65 6e 67 74 ......Assert.AreEqual(text.Lengt
5680 68 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 22 63 75 h,.m_TextEditor.cursorIndex,."cu
56a0 72 73 6f 72 49 6e 64 65 78 20 61 74 20 65 6e 64 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e rsorIndex.at.end.should.not.chan
56c0 67 65 22 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 ge");.....}......[Test].....[Tes
56e0 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e tCaseSource("textWithWordStartAn
5700 64 45 6e 64 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 dEndIndices")].....[TestCaseSour
5720 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 ce("textWithWordStartAndEndIndic
5740 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 4e 6f 74 41 57 6f 72 64 22 29 5d 0a esWherePunctuationIsNotAWord")].
5760 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 57 6f 72 64 52 69 67 68 74 5f 4d 6f ....public.void.MoveWordRight_Mo
5780 76 65 73 43 75 72 73 6f 72 54 6f 4e 65 78 74 57 6f 72 64 45 6e 64 28 73 74 72 69 6e 67 20 74 65 vesCursorToNextWordEnd(string.te
57a0 78 74 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b xt,.int[].wordStartIndices,.int[
57c0 5d 20 77 6f 72 64 45 6e 64 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 ].wordEndIndices).....{.........
57e0 69 66 20 28 74 65 78 74 2e 41 6e 79 28 63 68 61 72 2e 49 73 53 75 72 72 6f 67 61 74 65 29 29 0a if.(text.Any(char.IsSurrogate)).
5800 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 49 67 6e 6f 72 65 28 22 63 68 61 72 2e ............Assert.Ignore("char.
5820 49 73 4c 65 74 74 65 72 4f 72 44 69 67 69 74 28 73 74 72 69 6e 67 2c 20 69 6e 74 29 20 64 6f 65 IsLetterOrDigit(string,.int).doe
5840 73 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 77 6f 72 6b 20 63 6f 72 72 65 63 74 6c 79 20 77 s.not.currently.work.correctly.w
5860 69 74 68 20 73 75 72 72 6f 67 61 74 65 73 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 ith.surrogates");..........m_Tex
5880 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f tEditor.text.=.text;..........fo
58a0 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e r.(var.index.=.0;.index.<=.text.
58c0 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 Length;.index++).........{......
58e0 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 .......m_TextEditor.cursorIndex.
5900 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 =.m_TextEditor.selectIndex.=.ind
5920 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 ex;.............var.oldCursorInd
5940 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 ex.=.m_TextEditor.cursorIndex;..
5960 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 ...........var.oldSelectIndex.=.
5980 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 m_TextEditor.selectIndex;.......
59a0 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 57 6f 72 64 52 69 67 68 .......m_TextEditor.MoveWordRigh
59c0 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 78 74 57 6f 72 64 45 6e t();..............var.nextWordEn
59e0 64 20 3d 20 77 6f 72 64 45 6e 64 49 6e 64 69 63 65 73 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c d.=.wordEndIndices.FirstOrDefaul
5a00 74 28 69 20 3d 3e 20 69 20 3e 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 t(i.=>.i.>.oldCursorIndex);.....
5a20 20 20 20 20 20 20 20 20 69 66 20 28 6e 65 78 74 57 6f 72 64 45 6e 64 20 3d 3d 20 30 29 0a 20 20 ........if.(nextWordEnd.==.0)...
5a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 78 74 57 6f 72 64 45 6e 64 20 3d 20 74 65 78 74 ..............nextWordEnd.=.text
5a60 2e 4c 65 6e 67 74 68 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 .Length;.............Assert.AreE
5a80 71 75 61 6c 28 6e 65 78 74 57 6f 72 64 45 6e 64 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 qual(nextWordEnd,.m_TextEditor.c
5aa0 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f ursorIndex,.string.Format("curso
5ac0 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6e 65 78 74 20 rIndex.{0}.did.not.move.to.next.
5ae0 77 6f 72 64 20 73 74 61 72 74 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 word.start",.oldCursorIndex));..
5b00 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 78 74 57 ...........Assert.AreEqual(nextW
5b20 6f 72 64 45 6e 64 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 ordEnd,.m_TextEditor.selectIndex
5b40 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d ,.string.Format("selectIndex.{0}
5b60 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 6e 65 78 74 20 77 6f 72 64 20 73 74 61 72 74 .did.not.move.to.next.word.start
5b80 22 2c 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 ",.oldSelectIndex));.........}..
5ba0 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f ...}......[Test].....[TestCaseSo
5bc0 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 urce("textWithWordStartAndEndInd
5be0 69 63 65 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 ices")].....[TestCaseSource("tex
5c00 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 tWithWordStartAndEndIndicesWhere
5c20 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 41 57 6f 72 64 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 PunctuationIsAWord")].....public
5c40 20 76 6f 69 64 20 4d 6f 76 65 54 6f 53 74 61 72 74 4f 66 4e 65 78 74 57 6f 72 64 5f 4d 6f 76 65 .void.MoveToStartOfNextWord_Move
5c60 73 43 75 72 73 6f 72 54 6f 4e 65 78 74 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 sCursorToNextWordStart(string.te
5c80 78 74 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b xt,.int[].wordStartIndices,.int[
5ca0 5d 20 77 6f 72 64 45 6e 64 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 ].wordEndIndices).....{.........
5cc0 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 m_TextEditor.text.=.text;.......
5ce0 20 20 20 66 6f 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 ...for.(var.index.=.0;.index.<=.
5d00 74 65 78 74 2e 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a text.Length;.index++).........{.
5d20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 ............m_TextEditor.cursorI
5d40 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 ndex.=.m_TextEditor.selectIndex.
5d60 3d 20 69 6e 64 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 =.index;.............var.oldCurs
5d80 6f 72 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 orIndex.=.m_TextEditor.cursorInd
5da0 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 ex;.............var.oldSelectInd
5dc0 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a ex.=.m_TextEditor.selectIndex;..
5de0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 54 6f 53 ............m_TextEditor.MoveToS
5e00 74 61 72 74 4f 66 4e 65 78 74 57 6f 72 64 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 tartOfNextWord();..............v
5e20 61 72 20 6e 65 78 74 57 6f 72 64 53 74 61 72 74 20 3d 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 ar.nextWordStart.=.oldCursorInde
5e40 78 20 3d 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3f 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3a x.==.text.Length.?.text.Length.:
5e60 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2e 43 6f 6e 63 61 74 28 6e 65 77 5b 5d 20 7b .wordStartIndices.Concat(new[].{
5e80 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 7d 29 2e 46 69 72 73 74 28 69 20 3d 3e 20 69 20 3e 20 6f .text.Length.}).First(i.=>.i.>.o
5ea0 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 ldCursorIndex);.............Asse
5ec0 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 78 74 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 78 rt.AreEqual(nextWordStart,.m_Tex
5ee0 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d tEditor.cursorIndex,.string.Form
5f00 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 at("cursorIndex.{0}.did.not.move
5f20 20 74 6f 20 73 74 61 72 74 20 6f 66 20 6e 65 78 74 20 77 6f 72 64 22 2c 20 6f 6c 64 43 75 72 73 .to.start.of.next.word",.oldCurs
5f40 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 orIndex));.............Assert.Ar
5f60 65 45 71 75 61 6c 28 6e 65 78 74 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 78 74 45 64 69 74 eEqual(nextWordStart,.m_TextEdit
5f80 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 or.selectIndex,.string.Format("s
5fa0 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 73 electIndex.{0}.did.not.move.to.s
5fc0 74 61 72 74 20 6f 66 20 6e 65 78 74 20 77 6f 72 64 22 2c 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 tart.of.next.word",.oldSelectInd
5fe0 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 ex));.........}.....}......[Test
6000 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 ].....[TestCaseSource("textWithW
6020 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 5b 54 65 ordStartAndEndIndices")].....[Te
6040 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 stCaseSource("textWithWordStartA
6060 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 41 57 ndEndIndicesWherePunctuationIsAW
6080 6f 72 64 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 54 6f 45 6e 64 ord")].....public.void.MoveToEnd
60a0 4f 66 50 72 65 76 69 6f 75 73 57 6f 72 64 5f 4d 6f 76 65 73 43 75 72 73 6f 72 54 6f 50 72 65 76 OfPreviousWord_MovesCursorToPrev
60c0 69 6f 75 73 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d iousWordStart(string.text,.int[]
60e0 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 45 6e 64 .wordStartIndices,.int[].wordEnd
6100 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 Indices).....{.........m_TextEdi
6120 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 76 tor.text.=.text;..........for.(v
6140 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 6e 67 ar.index.=.0;.index.<=.text.Leng
6160 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 th;.index++).........{..........
6180 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 6d 5f ...m_TextEditor.cursorIndex.=.m_
61a0 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b 0a TextEditor.selectIndex.=.index;.
61c0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 20 3d ............var.oldCursorIndex.=
61e0 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 20 20 20 20 .m_TextEditor.cursorIndex;......
6200 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 6d 5f 54 65 .......var.oldSelectIndex.=.m_Te
6220 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 20 20 20 20 xtEditor.selectIndex;...........
6240 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 54 6f 45 6e 64 4f 66 50 72 65 76 69 ...m_TextEditor.MoveToEndOfPrevi
6260 6f 75 73 57 6f 72 64 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 72 65 76 ousWord();..............var.prev
6280 69 6f 75 73 57 6f 72 64 53 74 61 72 74 20 3d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 iousWordStart.=.wordStartIndices
62a0 2e 52 65 76 65 72 73 65 28 29 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c 74 28 69 20 3d 3e 20 69 .Reverse().FirstOrDefault(i.=>.i
62c0 20 3c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 .<.oldCursorIndex);.............
62e0 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 Assert.AreEqual(previousWordStar
6300 74 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 t,.m_TextEditor.cursorIndex,.str
6320 69 6e 67 2e 46 6f 72 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 ing.Format("cursorIndex.{0}.did.
6340 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 not.move.to.previous.word.start"
6360 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 ,.oldCursorIndex));.............
6380 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 Assert.AreEqual(previousWordStar
63a0 74 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 t,.m_TextEditor.selectIndex,.str
63c0 69 6e 67 2e 46 6f 72 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 ing.Format("selectIndex.{0}.did.
63e0 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 not.move.to.previous.word.start"
6400 2c 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 ,.oldSelectIndex));.........}...
6420 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 ..}......[Test].....[TestCaseSou
6440 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 rce("textWithWordStartAndEndIndi
6460 63 65 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 ces")].....[TestCaseSource("text
6480 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 72 65 50 WithWordStartAndEndIndicesWhereP
64a0 75 6e 63 74 75 61 74 69 6f 6e 49 73 41 57 6f 72 64 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 unctuationIsAWord")].....public.
64c0 76 6f 69 64 20 46 69 6e 64 53 74 61 72 74 4f 66 4e 65 78 74 57 6f 72 64 5f 52 65 74 75 72 6e 73 void.FindStartOfNextWord_Returns
64e0 49 6e 64 65 78 4f 66 4e 65 78 74 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 78 74 IndexOfNextWordStart(string.text
6500 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b 5d 20 ,.int[].wordStartIndices,.int[].
6520 77 6f 72 64 45 6e 64 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 wordEndIndices).....{.........if
6540 20 28 74 65 78 74 2e 41 6e 79 28 63 68 61 72 2e 49 73 53 75 72 72 6f 67 61 74 65 29 29 0a 20 20 .(text.Any(char.IsSurrogate))...
6560 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 49 67 6e 6f 72 65 28 22 63 68 61 72 2e 49 73 ..........Assert.Ignore("char.Is
6580 4c 65 74 74 65 72 4f 72 44 69 67 69 74 28 73 74 72 69 6e 67 2c 20 69 6e 74 29 20 64 6f 65 73 20 LetterOrDigit(string,.int).does.
65a0 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 77 6f 72 6b 20 63 6f 72 72 65 63 74 6c 79 20 77 69 74 not.currently.work.correctly.wit
65c0 68 20 73 75 72 72 6f 67 61 74 65 73 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 h.surrogates");..........m_TextE
65e0 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 ditor.text.=.text;..........for.
6600 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 (var.index.=.0;.index.<=.text.Le
6620 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 ngth;.index++).........{........
6640 20 20 20 20 20 76 61 72 20 6e 65 78 74 57 6f 72 64 53 74 61 72 74 20 3d 20 69 6e 64 65 78 20 3d .....var.nextWordStart.=.index.=
6660 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3f 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3a 20 77 6f =.text.Length.?.text.Length.:.wo
6680 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2e 43 6f 6e 63 61 74 28 6e 65 77 5b 5d 20 7b 74 65 78 rdStartIndices.Concat(new[].{tex
66a0 74 2e 4c 65 6e 67 74 68 7d 29 2e 46 69 72 73 74 28 69 20 3d 3e 20 69 20 3e 20 69 6e 64 65 78 29 t.Length}).First(i.=>.i.>.index)
66c0 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 ;.............Assert.AreEqual(ne
66e0 78 74 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 46 69 6e 64 53 74 xtWordStart,.m_TextEditor.FindSt
6700 61 72 74 4f 66 4e 65 78 74 57 6f 72 64 28 69 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d artOfNextWord(index));.........}
6720 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 .....}......[Test].....[TestCase
6740 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 Source("textWithWordStartAndEndI
6760 6e 64 69 63 65 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 ndices")].....[TestCaseSource("t
6780 65 78 74 57 69 74 68 57 6f 72 64 53 74 61 72 74 41 6e 64 45 6e 64 49 6e 64 69 63 65 73 57 68 65 extWithWordStartAndEndIndicesWhe
67a0 72 65 50 75 6e 63 74 75 61 74 69 6f 6e 49 73 4e 6f 74 41 57 6f 72 64 22 29 5d 0a 20 20 20 20 70 rePunctuationIsNotAWord")].....p
67c0 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 57 6f 72 64 4c 65 66 74 5f 4d 6f 76 65 73 43 75 72 ublic.void.MoveWordLeft_MovesCur
67e0 73 6f 72 54 6f 50 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 74 28 73 74 72 69 6e 67 20 74 65 sorToPreviousWordStart(string.te
6800 78 74 2c 20 69 6e 74 5b 5d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b xt,.int[].wordStartIndices,.int[
6820 5d 20 77 6f 72 64 45 6e 64 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 ].wordEndIndices).....{.........
6840 69 66 20 28 74 65 78 74 2e 41 6e 79 28 63 68 61 72 2e 49 73 53 75 72 72 6f 67 61 74 65 29 29 0a if.(text.Any(char.IsSurrogate)).
6860 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 49 67 6e 6f 72 65 28 22 63 68 61 72 2e ............Assert.Ignore("char.
6880 49 73 4c 65 74 74 65 72 4f 72 44 69 67 69 74 28 73 74 72 69 6e 67 2c 20 69 6e 74 29 20 64 6f 65 IsLetterOrDigit(string,.int).doe
68a0 73 20 6e 6f 74 20 63 75 72 72 65 6e 74 6c 79 20 77 6f 72 6b 20 63 6f 72 72 65 63 74 6c 79 20 77 s.not.currently.work.correctly.w
68c0 69 74 68 20 73 75 72 72 6f 67 61 74 65 73 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 ith.surrogates");..........m_Tex
68e0 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f tEditor.text.=.text;..........fo
6900 72 20 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e r.(var.index.=.0;.index.<=.text.
6920 4c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 Length;.index++).........{......
6940 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 .......m_TextEditor.cursorIndex.
6960 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 =.m_TextEditor.selectIndex.=.ind
6980 65 78 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 ex;.............var.oldCursorInd
69a0 65 78 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 20 ex.=.m_TextEditor.cursorIndex;..
69c0 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 53 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 ...........var.oldSelectIndex.=.
69e0 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 3b 0a 0a 20 20 20 20 20 m_TextEditor.selectIndex;.......
6a00 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 4d 6f 76 65 57 6f 72 64 4c 65 66 74 .......m_TextEditor.MoveWordLeft
6a20 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 72 65 76 69 6f 75 73 57 6f 72 ();..............var.previousWor
6a40 64 53 74 61 72 74 20 3d 20 77 6f 72 64 53 74 61 72 74 49 6e 64 69 63 65 73 2e 52 65 76 65 72 73 dStart.=.wordStartIndices.Revers
6a60 65 28 29 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c 74 28 69 20 3d 3e 20 69 20 3c 20 6f 6c 64 43 e().FirstOrDefault(i.=>.i.<.oldC
6a80 75 72 73 6f 72 49 6e 64 65 78 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e ursorIndex);.............Assert.
6aa0 41 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 AreEqual(previousWordStart,.m_Te
6ac0 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 xtEditor.cursorIndex,.string.For
6ae0 6d 61 74 28 22 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 mat("cursorIndex.{0}.did.not.mov
6b00 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 2c 20 6f 6c 64 43 75 e.to.previous.word.start",.oldCu
6b20 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e rsorIndex));.............Assert.
6b40 41 72 65 45 71 75 61 6c 28 70 72 65 76 69 6f 75 73 57 6f 72 64 53 74 61 72 74 2c 20 6d 5f 54 65 AreEqual(previousWordStart,.m_Te
6b60 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 xtEditor.selectIndex,.string.For
6b80 6d 61 74 28 22 73 65 6c 65 63 74 49 6e 64 65 78 20 7b 30 7d 20 64 69 64 20 6e 6f 74 20 6d 6f 76 mat("selectIndex.{0}.did.not.mov
6ba0 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 77 6f 72 64 20 73 74 61 72 74 22 2c 20 6f 6c 64 53 65 e.to.previous.word.start",.oldSe
6bc0 6c 65 63 74 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 lectIndex));.........}.....}....
6be0 20 20 5b 54 65 73 74 2c 20 54 65 73 74 43 61 73 65 53 6f 75 72 63 65 28 22 74 65 78 74 57 69 74 ..[Test,.TestCaseSource("textWit
6c00 68 45 78 70 65 63 74 65 64 43 75 72 73 6f 72 41 6e 64 53 65 6c 65 63 74 49 6e 64 69 63 65 73 57 hExpectedCursorAndSelectIndicesW
6c20 68 65 6e 53 65 6c 65 63 74 69 6e 67 43 75 72 72 65 6e 74 57 6f 72 64 41 74 49 6e 64 65 78 22 29 henSelectingCurrentWordAtIndex")
6c40 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 6c 65 63 74 43 75 72 72 65 6e 74 57 ].....public.void.SelectCurrentW
6c60 6f 72 64 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 5b 5d 20 65 78 70 65 63 74 65 64 43 ord(string.text,.int[].expectedC
6c80 75 72 73 6f 72 49 6e 64 69 63 65 73 2c 20 69 6e 74 5b 5d 20 65 78 70 65 63 74 65 64 53 65 6c 65 ursorIndices,.int[].expectedSele
6ca0 63 74 49 6e 64 69 63 65 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 ctIndices).....{.........m_TextE
6cc0 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 ditor.text.=.text;..........for.
6ce0 28 76 61 72 20 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78 20 3c 3d 20 74 65 78 74 2e 4c 65 (var.index.=.0;.index.<=.text.Le
6d00 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 ngth;.index++).........{........
6d20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 20 3d 20 .....m_TextEditor.cursorIndex.=.
6d40 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 6e 64 65 78 20 3d 20 69 6e 64 65 78 m_TextEditor.selectIndex.=.index
6d60 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 ;.............var.oldCursorIndex
6d80 20 3d 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 3b 0a 0a 20 20 .=.m_TextEditor.cursorIndex;....
6da0 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 43 75 72 ..........m_TextEditor.SelectCur
6dc0 72 65 6e 74 57 6f 72 64 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e rentWord();..............Assert.
6de0 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 43 75 72 73 6f 72 49 6e 64 69 63 65 73 5b 69 AreEqual(expectedCursorIndices[i
6e00 6e 64 65 78 5d 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c ndex],.m_TextEditor.cursorIndex,
6e20 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 77 72 6f 6e 67 20 63 75 72 73 6f 72 49 6e 64 65 .string.Format("wrong.cursorInde
6e40 78 20 66 6f 72 20 69 6e 69 74 69 61 6c 20 63 75 72 73 6f 72 49 6e 64 65 78 20 7b 30 7d 22 2c 20 x.for.initial.cursorIndex.{0}",.
6e60 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 oldCursorIndex));.............As
6e80 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 53 65 6c 65 63 74 49 6e 64 69 sert.AreEqual(expectedSelectIndi
6ea0 63 65 73 5b 69 6e 64 65 78 5d 2c 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 73 65 6c 65 63 74 49 ces[index],.m_TextEditor.selectI
6ec0 6e 64 65 78 2c 20 73 74 72 69 6e 67 2e 46 6f 72 6d 61 74 28 22 77 72 6f 6e 67 20 73 65 6c 65 63 ndex,.string.Format("wrong.selec
6ee0 74 49 6e 64 65 78 20 66 6f 72 20 69 6e 69 74 69 61 6c 20 63 75 72 73 6f 72 49 6e 64 65 78 20 7b tIndex.for.initial.cursorIndex.{
6f00 30 7d 22 2c 20 6f 6c 64 43 75 72 73 6f 72 49 6e 64 65 78 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0}",.oldCursorIndex));.........}
6f20 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f .....}......[Test].....public.vo
6f40 69 64 20 48 61 6e 64 6c 65 4b 65 79 45 76 65 6e 74 5f 57 69 74 68 43 6f 6e 74 72 6f 6c 41 4b 65 id.HandleKeyEvent_WithControlAKe
6f60 79 44 6f 77 6e 45 76 65 6e 74 5f 4d 6f 76 65 73 43 75 72 73 6f 72 54 6f 53 74 61 72 74 4f 66 4c yDownEvent_MovesCursorToStartOfL
6f80 69 6e 65 4f 6e 4d 61 63 4f 53 5f 53 65 6c 65 63 74 73 41 6c 6c 45 6c 73 65 77 68 65 72 65 28 29 ineOnMacOS_SelectsAllElsewhere()
6fa0 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 74 65 78 74 .....{.........const.string.text
6fc0 20 3d 20 22 66 6f 6f 22 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 .=."foo";.........m_TextEditor.t
6fe0 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 ext.=.text;.........m_TextEditor
7000 2e 4d 6f 76 65 4c 69 6e 65 45 6e 64 28 29 3b 0a 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 .MoveLineEnd();.........var.cont
7020 72 6f 6c 41 4b 65 79 44 6f 77 6e 45 76 65 6e 74 20 3d 20 6e 65 77 20 45 76 65 6e 74 20 7b 20 74 rolAKeyDownEvent.=.new.Event.{.t
7040 79 70 65 20 3d 20 45 76 65 6e 74 54 79 70 65 2e 4b 65 79 44 6f 77 6e 2c 20 6b 65 79 43 6f 64 65 ype.=.EventType.KeyDown,.keyCode
7060 20 3d 20 4b 65 79 43 6f 64 65 2e 41 2c 20 6d 6f 64 69 66 69 65 72 73 20 3d 20 45 76 65 6e 74 4d .=.KeyCode.A,.modifiers.=.EventM
7080 6f 64 69 66 69 65 72 73 2e 43 6f 6e 74 72 6f 6c 20 7d 3b 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 odifiers.Control.};..........m_T
70a0 65 78 74 45 64 69 74 6f 72 2e 48 61 6e 64 6c 65 4b 65 79 45 76 65 6e 74 28 63 6f 6e 74 72 6f 6c extEditor.HandleKeyEvent(control
70c0 41 4b 65 79 44 6f 77 6e 45 76 65 6e 74 29 3b 0a 0a 20 20 20 20 20 20 20 20 69 66 20 28 53 79 73 AKeyDownEvent);..........if.(Sys
70e0 74 65 6d 49 6e 66 6f 2e 6f 70 65 72 61 74 69 6e 67 53 79 73 74 65 6d 46 61 6d 69 6c 79 20 3d 3d temInfo.operatingSystemFamily.==
7100 20 4f 70 65 72 61 74 69 6e 67 53 79 73 74 65 6d 46 61 6d 69 6c 79 2e 4d 61 63 4f 53 58 29 0a 20 .OperatingSystemFamily.MacOSX)..
7120 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 54 68 61 74 .......{.............Assert.That
7140 28 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 65 64 54 65 78 74 2c 20 49 73 2e 45 (m_TextEditor.SelectedText,.Is.E
7160 6d 70 74 79 2c 20 22 53 65 6c 65 63 74 65 64 20 74 65 78 74 20 77 61 73 20 6e 6f 74 20 65 6d 70 mpty,."Selected.text.was.not.emp
7180 74 79 22 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 54 68 61 74 28 6d 5f ty");.............Assert.That(m_
71a0 54 65 78 74 45 64 69 74 6f 72 2e 63 75 72 73 6f 72 49 6e 64 65 78 2c 20 49 73 2e 45 71 75 61 6c TextEditor.cursorIndex,.Is.Equal
71c0 54 6f 28 30 29 2c 20 22 43 75 72 73 6f 72 20 64 69 64 20 6e 6f 74 20 6d 6f 76 65 20 74 6f 20 73 To(0),."Cursor.did.not.move.to.s
71e0 74 61 72 74 20 6f 66 20 6c 69 6e 65 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 tart.of.line");.........}.......
7200 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 54 68 61 74 28 6d ..else.............Assert.That(m
7220 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 65 6c 65 63 74 65 64 54 65 78 74 2c 20 49 73 2e 45 71 75 _TextEditor.SelectedText,.Is.Equ
7240 61 6c 54 6f 28 74 65 78 74 29 2c 20 22 54 65 78 74 20 77 61 73 20 6e 6f 74 20 73 65 6c 65 63 74 alTo(text),."Text.was.not.select
7260 65 64 22 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c ed");.....}......[Test].....publ
7280 69 63 20 76 6f 69 64 20 48 61 6e 64 6c 65 4b 65 79 45 76 65 6e 74 5f 57 69 74 68 43 6f 6d 6d 61 ic.void.HandleKeyEvent_WithComma
72a0 6e 64 41 4b 65 79 44 6f 77 6e 45 76 65 6e 74 5f 53 65 6c 65 63 74 73 41 6c 6c 4f 6e 4d 61 63 4f ndAKeyDownEvent_SelectsAllOnMacO
72c0 53 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 53 79 73 74 65 6d 49 6e 66 6f S().....{.........if.(SystemInfo
72e0 2e 6f 70 65 72 61 74 69 6e 67 53 79 73 74 65 6d 46 61 6d 69 6c 79 20 21 3d 20 4f 70 65 72 61 74 .operatingSystemFamily.!=.Operat
7300 69 6e 67 53 79 73 74 65 6d 46 61 6d 69 6c 79 2e 4d 61 63 4f 53 58 29 0a 20 20 20 20 20 20 20 20 ingSystemFamily.MacOSX).........
7320 20 20 20 20 41 73 73 65 72 74 2e 49 67 6e 6f 72 65 28 22 54 65 73 74 20 69 73 20 6f 6e 6c 79 20 ....Assert.Ignore("Test.is.only.
7340 61 70 70 6c 69 63 61 62 6c 65 20 6f 6e 20 6d 61 63 4f 53 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 applicable.on.macOS");..........
7360 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 74 65 78 74 20 3d 20 22 66 6f 6f 22 3b 0a 20 20 20 20 20 const.string.text.=."foo";......
7380 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 74 65 78 74 20 3d 20 74 65 78 74 3b 0a 20 20 20 ...m_TextEditor.text.=.text;....
73a0 20 20 20 20 20 76 61 72 20 63 6f 6d 6d 61 6e 64 41 4b 65 79 44 6f 77 6e 45 76 65 6e 74 20 3d 20 .....var.commandAKeyDownEvent.=.
73c0 6e 65 77 20 45 76 65 6e 74 20 7b 20 74 79 70 65 20 3d 20 45 76 65 6e 74 54 79 70 65 2e 4b 65 79 new.Event.{.type.=.EventType.Key
73e0 44 6f 77 6e 2c 20 6b 65 79 43 6f 64 65 20 3d 20 4b 65 79 43 6f 64 65 2e 41 2c 20 6d 6f 64 69 66 Down,.keyCode.=.KeyCode.A,.modif
7400 69 65 72 73 20 3d 20 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 2e 43 6f 6d 6d 61 6e 64 20 7d 3b iers.=.EventModifiers.Command.};
7420 0a 0a 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 48 61 6e 64 6c 65 4b 65 79 ..........m_TextEditor.HandleKey
7440 45 76 65 6e 74 28 63 6f 6d 6d 61 6e 64 41 4b 65 79 44 6f 77 6e 45 76 65 6e 74 29 3b 0a 0a 20 20 Event(commandAKeyDownEvent);....
7460 20 20 20 20 20 20 41 73 73 65 72 74 2e 54 68 61 74 28 6d 5f 54 65 78 74 45 64 69 74 6f 72 2e 53 ......Assert.That(m_TextEditor.S
7480 65 6c 65 63 74 65 64 54 65 78 74 2c 20 49 73 2e 45 71 75 61 6c 54 6f 28 74 65 78 74 29 2c 20 22 electedText,.Is.EqualTo(text),."
74a0 54 65 78 74 20 77 61 73 20 6e 6f 74 20 73 65 6c 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 7d Text.was.not.selected");.....}.}
74c0 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 54 65 78 74 ............................Text
74e0 45 64 69 74 6f 72 54 65 73 74 73 00 00 00 00 00 EditorTests.....