From f868bf42e849808a2b31da34dc5fa8229cc24406 Mon Sep 17 00:00:00 2001 From: Yad Smood Date: Thu, 26 May 2022 23:50:52 +0800 Subject: [PATCH] add performance test for lcs --- lib/diff/fixtures/rand_lcs.txt | 1 + lib/diff/fixtures/rand_x.txt | 10 ++++++++++ lib/diff/fixtures/rand_y.txt | 11 +++++++++++ lib/diff/lcs_test.go | 13 +++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 lib/diff/fixtures/rand_lcs.txt create mode 100644 lib/diff/fixtures/rand_x.txt create mode 100644 lib/diff/fixtures/rand_y.txt diff --git a/lib/diff/fixtures/rand_lcs.txt b/lib/diff/fixtures/rand_lcs.txt new file mode 100644 index 0000000..25aa656 --- /dev/null +++ b/lib/diff/fixtures/rand_lcs.txt @@ -0,0 +1 @@ +714c0082ca8b68d8201d10b4a042851385e78ae2e9d98c9ab41fcff3850a5fdd001e21325dfd7b3f9b8f4424ced9a810516f53cb177817f7dcd3de7a406a09077763d0e634fd520d343227b263615059339681db298658a76edff0d79ed2e6ed50e636a261b76960796ecdc2140d3ad47c086ad19ad37c234863454d66c81bfe7b2d5be7ff3d071a3c839dcd626afb7bae52be512b567b7ab9e9adb65eb01441db31162ff7fa501cdbf353943687ab27cabd4a0703776cec40dd96e172b14823cd542ea3668b41925e760e66895c1e1ef5080ee27d299d7562a24dcbfa7ac83402c9f0d0a421fe6ad0433ef62bbfa37fdfc0aa810dca1d08bd3527c92f571dc4565bc7d6afd7ddb63fe6b278727a71df653a9f76ff3176c553be119167470c2e4289ae48d2e39d16076c87ef45a15403ed1deae5f601a3219f09defbc615181c9d2eb3ead3947341692b40e306f05d23b804467f167d3 \ No newline at end of file diff --git a/lib/diff/fixtures/rand_x.txt b/lib/diff/fixtures/rand_x.txt new file mode 100644 index 0000000..b1cd707 --- /dev/null +++ b/lib/diff/fixtures/rand_x.txt @@ -0,0 +1,10 @@ +cafbc7138c65f4893d8be6b1842ce70d29b33d8e637b54f9e8430ec51892eb4f711baf02e46fcab1cf0ab6297f9d123baea7e26e56b137e83a28a0c17ab2fc65ba57fbb924f1b1d7954b9d0a7f03db5d71d2eb53de8a0dc1d720736af3c7043b07f8be6c58fd0df4a9159dc64a91d2c99e2dfd6009fe01ddd5171c674d57b6dc53084c99fc7f6cf1b4d42cabca269db1d280c1d99adb25afd06ca3205c675b6f03f5b7049ef22b33ebce9e8f62dbe53adc943815027e1438e3afa8a81acf88cad268c11452d3b322f25aacfcf9e5cc2fc2e7beaafaeaad42286b165b9924f872a219f75976e72892bf0f4a3d4f7da01d02c9d9891f6d9cc35e1b026baa31a02863b0589be92caca4361a054ff898b4da8140ea0beff652dd11e3a7aff4fc938fd11d0ec2147fff92d2bd772ed66505048531645c8c462dde60e801f27411b66aa4f6caab1f7a38a4b5dc8363c4d0b49435b3fc209d39a02126ec713fad0cec6433fe1977ccfbe62063853bb05630b7ae266db983a33de301d13f7103735100d3719a3d7b6b91d77e6ae2877724ea5d5f9a484d0516fbd8fd5a35355fb7a13182085dce25c6192b9c378a806cb815218a297a210890d5e364b0e7e1080de5fd30e88ea646889b8794aa3fff37b7592ea6a6937efcf733b89c5ebb710f58a8d491fb71156d09b6dcdabe62939fc80bf2de68b58575ce7ae193 +6bf09e8446a6048c0adbdb993229e7e1e2c22569e1046de6958365804587e18c24280a568152aea4a456b1ed6cd1b7d3f62c28b398e5e3d50d9864eabd8755af956b06751031ae8b320c7e9c7db17917de1096c686797f66943f90f121d826005c019fbd42fa68b6ac2489d35a45a03cd83ab90c44b86c29a11810660cd4f4d75cbc790dd44d22a50b43804223b292c413b8c9ae1d24c8cced1b028b45453d95889cfa36ace4dc63266ee81c6f2323c579ed3ed7491313dedaee8a326c5301f14490adbd061de5a6de51a495a1381262806850a95fe147f7577ec1eb5919ab0e8cd4318de21cc4afb90e379d47763d1cbc771b3cb4512bd8fedb5ed8afc624cdfc05df19da02b8a71133a7fb396f69941301a5fe1e4e8c08486ee177518a4993307ddf190390eacffb8a33facaf53058c5e9b8b43d51e8a8ef4255d6fc08685d2d57e09f097a2bc362da77acf4b87aba6cf090ae3afce674cbe2a799fac1d16bb615b34df0c4a354ba68513d74e974c3afd021c27a256fe8681ff0def4c5a37195a29830989e60130980b35ec4b6b780c4c241d71fc286999d4d3d99cde2aa8f9aa599655395400d0c5ef7754a5ce5aae61b27f49df6a4b6b6be2eaabb303e1d09f405778301d8e38ef33b428ae0ac4d8634a09e54f4db4044c14add43d5fae8816ed2bb42dd51a08df7f8ce0a210ce6211e3642396f6e978d197818bb268181 +31d3f12e478588b91c376b897c65ca77a9773b780a55a3a06885ce1cc0d56cf5fededfd4bd252f0393b237d8cb171120e9a5f54b5b5d062d7e2ffe21441350488462afac674ce6085b2ab48a93ebad5385c50ec56e8d1fcda49b20ff7f97c83579221e7a3857be17ec54ff722c4af1edfc3b322d7c9b4cc5709615dc71cd3db27d4beb9e8e3e765e22b48ced5451f3bb93f2c3b2b613d200d0598dfdae65f66e64da9cd076e99c73a536317dc969b706f397c6604cca6fe8f0d02c64020129e0ca782c0695819c3f108de496eabab94003440379c6b83e1410d027ce18fe8d8064d03e3e6b7ec4c57710a505dc5e217b92a9bd78a52f807b4b4404f0cdca6fb4ad63ac08860ff3adf2755435849c833795a312d53c214d189ced21abadbebe3089226f5e7ebb96dbf12556b16a393449d028b26ab7039677a6976226d937d137af752ddb60f66aa3256734f3a68e1806474b21e1046c8c04170d509db48b96eeef7eb937ce1631b7f182905c77ab1f286aab468e923937ac1bb1721522d79857f227531df7bab255eb1822187a4239f746d828c2f742e8f4ebba081973db829b5150a3faa73426421a7b79965e65653ef7a39744f35b932a19ed96e126352f70d1b164e0b07beaa8a0b1abf60dfcd96ce5ee8716d9df0eebcaf12032c775a5db7d80aa40048a0e099cd7d714ee407307be24c84f4f5b39cd52c6fc52c7146f44 +7ab4acf1d1b233a225d0ddbc58fa9315b9d40f3d29fb853ff6a458501ad3bea151fdc97852912f1e85d02df0d36298cac50d849357233bd24c84c2a62505445f16a36a5a0c971216c0aedb24c3086ab21b7ac96c519db46896b211ebc3d6c58bf0ad614ec21c3c5f9e2007116890b8d9d643400da673f9c774de8541b8f5288b1e7aa7216435b7316e8220178bf8360fa925560814dd9c982dca8e4b212d8b54afbe79392a8ef545bd21b115a469b47b3d9abfad8ad7d54a2e720c9b6447aa48e7ffa49eb31b37473e2a1e95173523f623a9e03624cdc2cf89ec1d72f2510e49ccb45f4631a5f4fc14a9258f58f9983d6061459ef521c2dcec3220e6ff607c71176968e8560a6334881ca5fd9037c4ae349353a3a5523ced9b3bb7e94c099f91c5335f4bc229c5cb6aa7176a5e951b1089b722dcd14cbcba88f8bcab6357363da49350897f926d1329dfc41e213798b8415eed117e58db9d1253e8ca61a80c137d5fa7c365e21e281819925567a455d0e335de2b3c703d424c4d5c9f38bd9217493e13256ad2ec9566f8280b8491ff1b116666d8e7f4d37e91b9d7f4318407ae91a23a245791d1615f102180f7a8e8d830abb70f7dfa9317fa495c06612fc0d400500a3c075e8a7d3ce64f554b5e39026b9a164e6f777900f39abecffeaebdc7f645dfa83809f4a47ed2e4c3a973473d54de6320b18455ebc67ac398a1616db2 +3e9eab2d428e88368f53c2a116d75a21ab8a363695c8baa3e49cb42ad66b8e9eefd9faa9211e9f2427c60e0770a038d59800a4fac48d855f8e0b4cfd70073c419876a05bf29c8d80fdddaae86f82d897fab02a80d11a582203e8f5bee7de53df3421501085e0840ddb82ff5ea706b251fabde22ef9f81d4a792141fc97cf7c7e3e89685b4c436d9b4d12251af5afa683c85d164a2546f5889f833ae9305db258d54f7a5e40f1d86bb1c4ef944e9baa363f965bbfdd92940492227820528ae5f36872222f4ae0924bbf98c59112124f9ff6c7215ca454e3a85621f417c7517119ccdaf7dc785c672843bf26bc6c89d249a47c2125139dde9f2d13afba8a1d75daa37d45bf798d8608884df790738a75ab0d5fadf5a8b096f7845bea918f85e256546e5862f9490b7fe50e88ff2387271c1f0074cb9f17aa3706b82182d896c2ef0cbb9f66243bbe4eb6816d6694a6a8df52271cf62d01a1b048c030874b90615b1829a286ee79107cdde1c9b7d5aad01c9e2c70efb5fe0588a31143d72fbe49cf5a02e93ae04e3f7f78351209bf0cf401151c58c696efb24e55e01f18753bfee698faaf1108e2ccd5e1c64379b2080f18202a7cb473059dde81605df56a38c396882f3a3f67b78d95cb8dd6f73a757dc80b470018b830b8c5b33db6b04cf974d9307958ee2e3f90d08065358d4f41dc17d536670a788403977b471e7cfb8a9e00 +d66c5afc2c4f2f52b340da13e14669110b67e17171de1a64ef0034208bdf004da20fa5d6860b02e01c1a6fe4b282eddc4dd752b7b0408b0d49ea5a21eeab0878f69ffcd0e6c709505d0ca9add26546f73dc3edc3b698a2651faa05132fe430b47ab4c7dabbd4696e10cfa7570077d9dac191770ef9c71f064ff66042e6dbfccc154972c2e3219d1f80c10bfbde2643b3b6222fb3d61ad5eeb2db1ea4f28b05e0a05862d99ed648ec02943cbc1d6f55f4f90b645926c057d09cd7c80fb506e1b9a679a3915cdbe11f1ef8235d8a541281af84a8fb5645f03d6c776a552d6813cb1c9b8db0cade0c6cd33f6cdd8ee22b26e2ea20b88b930169a630f5b6fbad2d37b5f68de25a050ed9101ccd2af7a56eb9dfefbb5009294624266ffd930b2977a41b2f0bcde3e40d0228cc0ac0bb588578cdd978de9182b72c6b3fc77ce0deea92cc13623320d8a5b73a51398d4d6e1b77712f1ce2301d04020f2508364d8ffc091c6d9b6fcdc14fcdf6464d9ac892a85720547000c0445163bbe61048c57a8952fe4e9786a6e56e1c2c63d7a0e6be32664c79b0724fc1c41a8ce409d1bc3394fb5b45142a2fa2511a560c52ce760b5e67886271fa5d135ee041eeca8ac541be055164c0a97c8f7146c959dc4f21c4bac1e0da9cedda28efe8ca0089dc4cc3ae877e5b922f2469a9e01963e4905b8f15760be43f5c544074f838d1da1d8411c1fa +f4612608bd2cc3248c460a3212842e130f882dde1bb3ce02b964b718cc6ceff7800b481423272979c5f2ff40d89b6f42bf802e899cea50249b5e06005a85b96f53ac52691b525aa137214af7e0b13ebf042b5b219f9e42fe404a5b64d93f944b436ecb7fa15b103c2908d60246bec8b227ccec01876a78814857c2efd8320286d3f71d7017c2e5970e7bfd6fcbf6423714362269f845b5d207d46535067862618758288f31b69aa7f8ee521a75bff2d09c300d263f65217ac2e0bd4243b8d57f7a557c7fea8f1e65fae73025dafdc18bdcd65dd558672bab752776b1341d38dd4eea6bdc47bb862fbc1caeb54e303dddb6708a07ccf7476490e47238beeccada5d59d7e6bc07995325052b4ff595a11040dc5ec227fc084ad639faffe339b8335d83ebef89086ef2db9af843cbcb0b6aa90d42f90a12705560997aad9d5ee0a775b3042e61a7b54c23048955cc15d01d2bd87e71b3b06caaea129b318a02e8002edc8e36fc32dce659a549d2c0c8910f23fd9c4630dd0ba2c23bad04af64a63a718164f264107f5fac38c288a470b8b0b35e2c59904c6e6b7f68a35b263ebb7d15144167da90e635f218f4b08c1560d901ba23b5aeee0a93ce4aaaf567b5c312473ad12250af7253d5e2e105ef7636c2f343d9028e30777d72d3cf34f6fc65560274fc94c91fc5365239fd872df1af0144ab3c730600fdb5d574a7f13cd5d69a +379e285ef92eaf4d51866026752c0ff907d5c561e72dd6189dfe02cf1b472877a56f094f001ebd0b520d4767b4b284d2a9b2532eb1b073c98f8273d0608940f9e0bf8943b6be3fec75da35ce3e178edbd81fa463d65bcf92e68383e96bfc355a947370ac5dade06c924536078b6732232b64cce42becc01f5b82298b740cd56ce9adf241f026e539880bd5ffc7fc7eb5a344bf5d2e25aa05411ca008c6755b829d0fc2c1043df3f68e310a89774bab0f4c418b11046d1dd7f9a009b0f769f6487b97672450214acd27ced9852b723b092c86e29ca52d994b7a89d45127dcd1d8bcb8b39745797a4aa2e8999a286affba1d35d0bd1c1f8ee5f31db4d81a12fa2905f90eef733b12754cd8257cbcd14e7cfa173bb2660fb15a3743123bbaf122e061aef4c277686360ed3eddea902501457897545b81b94a96d6a2cbf0f4050a5dc4c582ff844c6aecc2cf1a4d88078a45304fa8bbf3ba0883481a2f4140fa2eba86256134168a47a85424ee5492a113828d7c1455c661acdd894a426a70189a3cf661f9f96773f7784b22b2b6251457381282b1278f6189e4a33b61ff9540ae2ecd42ecdae54a583860e2f9c9f56e0576fd08872a6ec35ae9c1a91157e41a141a745ee75c98901519d35be96044a391e5dffd2e4527fe51aa75d1fc8d09f50be9493d1f184acf16fe3e1ab763d23a6a3b07adb33f360456b8320f85738a68b637 +6b47bc2ca754c8aab06ecc0b68d2890309a5af3452d59d3b74dc3727810e9f94722a650e3ffbfe9cee1b675c3fb3d57ca7895615576837065ae6caed22f0012e6c338d2568858def54b6d72c0b1bac74b2f1c649d24aa11dec632112a7313da2a8436b1b47e45d74eb1ecbea3d3dd0683dfacc05424ac4900fc2b674aef277732958339b9e5d0730c43b3dc07337ad5617bdf4a07d31be74f8816c4d16c44a33394b7180b4571fbb70c02c1f01c528f1fe9676af4efbe72e20b6d182ee37c2acec0b55348539b0e7d21beb5bce85ea35dce617020eeccfb60463fb5b6a96a454be590fab89156afeed18752fe99983a7e2b823a709d6cedf11fa06660b648cde986c63923a389f4691d77cc9bdbcff3da0100d30409c884378fb60f8d304b2ad166c441daba64fb8c5720c45e6eefa5111675b36eba82885b3e89a420575b104fd448c5fca2221b467c3b6e4972cde4d5dec8bbdd4e439ab139a83a69d6726870140c39bde2c9dc2f4181a35f846450e8b2d0f5f0e8ca5550ad9428fc0561798fcfe45cafae3389f8f24b21bfe5a67bf864e6637544476995da8a4508ae8728cd0aacf11da202c4091a5482be294407cd6908eb58b90a21650a25bf1ac864b73188303163f230d3073779a518d25f21d0d594e3e3b496e3338a4c34bb6efb1940e532528be51e058ebedbfa8635a8bc2eea44d3a1d4b1716ae28853d846daa6d +3e4a86cbfc1c726e637ec0f5ea1541520a2e76ecc2eaff32d9ff3b295a36491c1a8c5c221ceb7e5ffb9638d296469059abfdbfed3ef90053459b6c5ab6889913b4c5755d694e341c974c67970d5106cedf34a0214f461fc0ce135a2f242c5633e040a8dd5557094bf193561a3fc5a16261955bb4b280af6f246bed4bfa068aca5d28541f0a3385255a2b6564847d4e70f01bdcbc0ba90b05ecc51da161ff55a6742d2d9c940443ea37216aa5254619a458d05bdd3f3a13d673a935f548175e4e1c8201217a175d393b24dd7f9f00f411873ab9cf7bc6909fec0a3907019af7447e6542af37a7fa9b53ef9fc2cd284a0a6a752f7cce1989b5425925ee80f4eb9d7c87f529a893777ee072d20808104e11c2017730a264f79c19c97ad2290d4d881331dcd21f6073502e1654f987831982c4b8ec8a196c68ec997650d54f2a25d3b49efbcf56936ea8d5aa3c256a42f9efcf3bdc4b02b3bf8b34fb464f2676469ee8554dcdf2c6a0d8625307ee6eb78d063b1e2b4882df8381685db892775fa30c0b14554dec68f8bffdeee32dbd4851a9 \ No newline at end of file diff --git a/lib/diff/fixtures/rand_y.txt b/lib/diff/fixtures/rand_y.txt new file mode 100644 index 0000000..9fb4501 --- /dev/null +++ b/lib/diff/fixtures/rand_y.txt @@ -0,0 +1,11 @@ +1ccae45c789872d963004aca867d164ffcb32fc982ab081dfd9f50ba7eb59c1d6866e09fba063c5929e832c42e48d787df74448fb8154212031972738d322520c66616bf073c8323344a93647fa585d0a2d83c94b8dccec751d1eea283 +a487063b1c18cb81b7860a066313636b6d295db08fd2fc74c88df5141ff79e9e906508ad7ad96de9c6c8affcf715181d06d55bad5e6612bd89f1994c12b9e9acde44626436fef8d833461bff0da229a866b943029d8f9378c6d9bdff8c4e10374658e4809af12019c9641524751cfe1847034dccd2783e5faa7ee8e6dedc8d07a0ee3307c4b9d9e871605e51cb5bd436906ebb9fb7f77e73e50705547d5c70a0f294e6ac2b9657168e742bc5e3a8f6305fd2ce4990d7bc0469fe86968e8bc1e1715420d7099684c3199a173f1f1194c3fdc8d0707b8858919540d927ee074822d1d3dcf82d238ba48b69c29a652e285d9c271e912e20d89188161e84fe0e2d29a3927b522afea85f48625294f1bd1c7b0c1d2a1bf77992c969a660734cba1449f9dbd5864112f150c48e686b78ed42f87237daab851d6db23485ccdde9b33e696d654ef4e77cb3b8e70edd895deb5779909a84096c3ef8dd6f5d84fbcf7a27195bb1c8c1a974bd505d19bec40aac45222cb48f585b95abb1372631f0146c5028e8ea92255f4551cb9dab524d602be59c6d7d14a3f047149cb9ce2c29c185a5512601e935ea50ea10f7d2abe1d7ac0570599287749a8d42b5e4965b383350886e04b5b2a8479041a4b5bcae403bbe28b16537abeee80e6e53947af098da082278e2db3f0224f8d34f6d77b3175e5bf91a30913aa9aa6ee8bee67e3b41a0b8816f +f56573ff974827c95ad0976e2f23b4d8cdd92222cf7383d2b1a68370cde51f432dbc2d6f09f610870087e2fcc24e4e778813dcf2b32d5e40cc2b68aef370a6889c7c1cd825e9aa64a7f16d38f962a7dd55ed36f42020c2847aa8975abaf470fa5289241ad81d3f42fa1f7af278a0504fc066381e3f0d759190e37f94eb80b6813963eabedbaef8d8a10014b578a77420ee6c3d24c18332def0d49b1a4cc5cd42cb79c401f9c1c2d8be1ae20ed3a5ad09e26e4a5b44ceee1319725317202c397b0f4bb84eb94116f2c88f743060ec8da6d6cd22d6d299d4b0edb04bde797ed399bd5c75c68b3e8f78b962f1f8ee9b964f2637750c44f6d33bad22b40033e3122f82e44ef83938f9a1a1f5aeaab2fa8d56c5590c056a7645b0d983b9a1bf46193d3be23f20fbb2a52830bdccd5d31bdcff4444ef33b083fbcdf810a8c17adf0cdbe0b38afdf9ad520588392f1148e301b231f11b35876b52f0ff6d57c7e73e43f18c61f3b398ddc8b03ecb985d154edc7a0733045042ee688205e0df6708640d72ee33e28a7ba540d4ca66ea4261b123824dfafa95043f0e37268da7cbbedc022a1bd50e1a6a4f18664c118697a3cf554ebc26ca73325d1dabc800084b4f76635999872700891e242f5fd754f96f8424b5fef425ee3e69c14e9e84b2af3a7f00a33813251e6f5d808f55f1b140c63322f390f28f4497fb6eb0023ea3f3985a044f +cfc4b1aa6807dc28368bfb0afe0625fb96c6a553007d478974266091175361814f3fc5f786f2c719fd2f870b84357f637e9d51ba87a5d8ffc9d16511f19f418c9d9d595023a7cd4d4be8140cacadfbc41906d51d04e7f0659f296819eb7da90b784efdd7ef732e00b5c5a42f4dd4403d12de669284c59096909abe95fa86adac039226e3cf04614b824054cd78c0719dc2ebcdf1da0811b5dd13d4552b9a9132eedc3ad658b8fa98fcfea0245def34cb99719e7a8544db59e7e7f85364c35f8207403324d0398620ca70acc41f742236b64b00c143f7c87467bf72c518633f76563d496ce6d427a136564c72255a23a4e8e0a9b054bd62608d7bf3e766a8546f9bd594ef9882453b1a4c1467ddf0b1a59018baa2c3680240b8f0794010325c9a5c010bc2753748ff1ddd0ad6605da3d10b73d1bc1ebd26c2257bf55d0633320312cc73466a6b682aba15258099a0e814a1d028d3c4d2f283c054f63831423b7c45ca7402a23ecb7ce0ee4a39fdf81d17558e802ab4092531471202e3371e58476652df9b1a24859c580ad3c247ffdda4eeb092a2285529adbbb124fe43c9c80e59e302d8e26cf5bf2a0ff94f6525fa353b765f66aaf4f8a635d831e28ab99d88116228c6eba0c9a1cccd9c87dfb9c3cc4092020ff38ee7aeadb0837ab533f8cad5cce0ae02bd8d7d2313b2a7bff29b880ced4245873b5ee17adaf4bbd80cd1c6 +15feb496559319b4ad3ca5e7a2f49f30da9b7de872e9ff4d66781e25d920f1bb18bcf426790ab3ba4c520104ed5d7480232cbf23caec6e1aa3bf726a72ccf473cddca8127bb014b655ff9eb8822733374cc207902c97986a1cc964fde90e33956cd97566b530606d78bab9797f95b1f1921da18c25d794636fe45c045b152ebe7bd10b53841609c441ce2ecb97b253b0be54aea3e3b9aa3039ea07201eb5df6e22ae46e7db755db170c06b5b57e4708c1d5138e81be6ece118150adfebc72b934837149cb74798635498fa7cec653ee90f49095d3ba31a9db59d735f25ec0d745b26d4e6ef37519e152fb2e2611e539462080bad958791f98cd6641d07123d158bde844341db9388f6aa6efeccd499f0153903db1cf862b70220e3a64ad95cb6d410b4e7690488ebe749121968f556827ca7cd0e142d55b59e6616903dc1da903c170d3af578f0be77931525e2d44c8291c18377776cda7c76a7cffe0fa1a57e2b9587ff0e2b0523784d6030e8af51a2709fdb98e5beb2f7802a206647096114d9fdbdc4e4858d77275e050c547a708cf7a01d7e33c97791d9d95c713b76b106ffb65d2a40951b766c1721842245906e6a5147407ae218cd1123907a5c3b2e4574410be23568c9ca4e0c35ffbb88edbac3f3345f9f141cb2ab0ac50f5d15e01ad3ece22e95f693a91bb9254e6543d21602304d97ae4ebfd94dee397e7c0e95bf +c0de8db253b38bace2dc05f505ec7886c4adf0ebb797ec8c87d8366efca43bf049870046a1f50e0cee20ad91b13cf63bb9f9b4a8745c04b25472c57187733f6f894f29c77bf4e82e712922bbf4b51e1a528714c0082ca8b68d8201d10b4a042851385e78ae2e9d98c9ab41fcff3850a5fdd001e21325dfd7b3f9b8f4424ced9a810516f53cb177817f7dcd3de7a406a09077763d0e634fd520d343227b263615059339681db298658a76edff0d79ed2e6ed50e636a261b76960796ecdc2140d3ad47c086ad19ad37c234863454d66c81bfe7b2d5be7ff3d071a3c839dcd626afb7bae52be512b567b7ab9e9adb65eb01441db31162ff7fa501cdbf353943687ab27cabd4a0703776cec40dd96e172b14823cd542ea3668b41925e760e66895c1e1ef5080ee27d299d7562a24dcbfa7ac83402c9f0d0a421fe6ad0433ef62bbfa37fdfc0aa810dca1d08bd3527c92f571dc4565bc7d6afd7ddb63fe6b278727a71df653a9f76ff3176c553be119167470c2e4289ae48d2e39d16076c87ef45a15403ed1deae5f601a3219f09defbc615181c9d2eb3ead3947341692b40e306f05d23b804467f167d3c142a11ff92f6a467ee979a44f89482400114319ce04dc3573880e0bf89bd302833a78ff65bc98d578ed0747395a09ce82686948d17c3ce8f3a1b16acad265263ba5335946c25694b85448b900ce57c41daaa25af709946a +8e239b02fc7d7bdd8adf979fe4274b575e7294634a41fbaa881808a1dbb095801df8f233fa98e10da2966f7ea0fe622079992ff65cce325ad318aac58160a646430bb286790d5fdeadcf76f213252e5012f6b1f1e1c40c82457ab3d195395330b144d6a143ade5c93bd1f99b7aa6d2a36bcf73defcd0e4d1e9faba3cddcc67ef3f10e9398b9e2e88a4a5056760f4e5bfac8dc54dd7800d617cd491919ff795b50d8deecf8dab31a9cb8b853d5713f3dc724b7697c237958b3e81d1fd0e2fa80567b64bfef8f5b5b617133f68850935723f2d4e8ffe469d179894e3b40c52b4057983ba209e92ae7b05d7bf915813eb16ec812d0b255fb081bff6cde50bd5084223f8acd3531d6ba88494e622a30778052953f6af3cace4d6e1a391095c721ea6d04b046b5f73f0ab9751c1f214f6a3b285c31cef577538692200d5ef64f9951b2092f228de18d2e8a1ce00563cd740688c8f68a687d9c0deb629b669681da5814f064c1a53eb3e9af6647ed2277b5d129e96bf37c6c9980c8da1c35c7d0c0440594ca816acbd25eac8e119c75be92288e6cbc41dbb2555a5a75881255114dd1568b7751fa3a31bd25124996cf5b08c97f8abbe0fb289e701afb7fa1f2bbd5c6bc166aed755440cfea44666a8c5c9b7434e07217c099cd3faf6eb8dce98252cd7539336f107adb3976aafb4e74934cbb50ced1035b75634c28d03f789aaba1ea1 +96cbbd17113c5b5ecbfc13a57970388390ff0bff35460f5c3349eef5910bf503b15ccdef4c2380b56760e7be210ceef0b7b53b2e4e3fd10c1fc363cb9b62b6502dafddaeee4c339e6abdb00cfaf7d06efb4cd8a4669f67407b5015343a9f6836de83ea63d683f22080ce796dfda3f66afed1ec32db6be86c04da615f306b7386613adfc6fbc6eb2c7d05475bb4c778442b8cd48f379d8b5397e7483970ae95136f642524d672c813bcdf37f75aa1b9c1aea939bc95d283260afc0ccf7c769665b0fd7acc0ac0876813b26fb34b0a40dcb94c1408639d4b0465f83c13a65646bdfc5346131083d181c6e1019d7ed9f99c4918e922c37034b438110e5bf09d300835a21461faef7750cadbc25a84d1b5e297d04d81a24571c335e3a23b9ab3434c51cdafbcb1a5f1595d5572cd9215d0235c93430731a2cb7323e012453ca5f668b927205c963887ace974a3ce60ec22c4aa38b6ff4e5cfcfae6e22a650d402c95704f28a0177cb4d91643f446a7872995ca26dc388cb4987dd2a524f5f264add23ccaaba9a91979a58d261eb79d4b8fb9ea24d0df89d00e41a832df8c58ac796d89aba1d3b12170bb86581ff77bbc6bc25ca7afd169831686a4dc0c5e9d9cb1db5f85d676630ca942a0f699a68344f2d45c4655cf99ead2f16f9391f18261a65c1c8a719707e6dcdbc1066d0b42d9ffac20cdfd3f0c279b7667dbc773ce4ffac4 +81bb18378d30e14ef506a89cf67dceca0a659ff0756e2e006fc63fa6d88d263c3d5e96b527bf0b186be2db76612f14df5fb3f1c186ee1d657b16b3d7138017f74bbe736c0c089cfcb3703bd6c37a0a0fcb0111514ba75ff2598d56670af697cdbb145d327911020a5c4169e6ce11ed487b82a04e2b16e1b4f4573a609b1a6e654df238c0c4fdfe9db271d9e75826cf483cb15d084e9b4b4a27c0d210eb2254e6032485c091926d2d5ca5271d3df46e230344e6594c2027ed49c43e87e75d6f643c8a131e22cedc77ba1f29c9d331661099800ab6131d9659034b293076a07c0f9258b8f780b9702b635c3cc0a17c9ebc74d8d63e7669fd13414aa02bd3a6cba6aa60e912af70c80aeb04b1e3029a4b9c0440c4ebdfaed272f4a27498117a4850e34a99e8042f7544a24a03c7abc16c9071770ae6b2e87e91d276f03df5fb7d8db31012d18e660c7f4e4c7fb6aa399d3c0e21dd12922a35a653ba994554dd7f5606b70a48ed871c0bdedf835a204cae1a29cefc5a38eb03c1a97b366225bbf7d77cb7572536ba26b2313b7376eef4cfad465310ad2072c5e7844aec0bbfe01add4519b7b8864946ad8dc4b630efebb4594de9f438cd31fc9a72e659a13f556dc4c0147f3fde4cccae5a8eac03288bf9c76d4720ab016fb251418d85f31fe4256c341a6e6a22beb6b7b7db967d659a55d92f56c6dd487eae11ff85aa7ed4bafe26 +3fb6bc8d76beb85e9f981414b11aa19d6ee57c9fe31d77d2ee61a098079f26f03c6500d0cf5b92756b8d68088985070de06247f75aeb182113680e3fd0ff46a27bd9e9ee6e0ef135e0a143a2fb98fbe7abcff5368c11f0bdae8233bd32ea7ba2ae013bdbcd43eb9df772a9356b56b304c55a76376e58949a99d9d8f95f10c2fff948c2a7d819da4c783f38670cd7e121f7f0174025b4b6aa5d78eeb31a85282ea4d129281c97a879194592d1d96b5b1c958080b80e726bba3955957da86568f7247854566a591f0865465c5f8f40ed504a5c30247a2de2647a4e085f2e86a20cd9cfa5616964720e0d3cd1f4332ffc01c6441b6081ff7ed668e9695c220cee84b40b880f9ef0851c9bc000fa5733ca69356aa5a05c69552cbc48ef8702e4bab1ed85f0e288d4f5b79b4ec711e98e856f85d862bf94a5d6df537abe87b708f38ebcbd86af45defc4e5ac59d922ad5a79c86481129faad100a06ecb21491371cd25e30df5982a192271f839bca2808ec0208202c8b267be6cbf8f7d59fe8e8d2f215dcc3d4e2e0907240c181577e766eb683bb63b3ee7393948f6ded59d2c5cdfaa310227bcceda7836307bcefef5903cb159e80e2c278c03a417df45b43544e61a54f458e2cfe74bacfed1868885aa2c175ff24552c1d2a7eb14721f19c0b72d5c7af68c7f9bc726767ecd78ad21c624a580505532adde1ad8666b3eff67543e1 +31a22b0d24e69c96da1e9f215c1c748a752a498de9bbd70903a19bc242e5754284a84f275ce255eb874d1c114505aabddc88ae5b496bfeab58f78bf572b893f1f4c0cefb4d13f55d3ef673accba46526422a340536a141d6f817d14b03dec901ee52583ee9a3ac485fc841b74180acc7379376e0d8ea1149ea40c51e721d1939cad2e3a6facb9a1999c781c147444eed675da07cc18943eaabcc555af87cf46a932e668c36c9e6511b1167ace4bdddad2554ecdb083e23a4e3b690da4045d5bc0252659bfed9f8854a869a646176269e4d339f3a6fa30cab6bc515516c83f6855ad9f1858b70fc183772822a8270dd82e9337982cfc394c5db1255bb130a6d3ba253e826ed36f5f37820e212c3922e08911af952ed72c8ef528d76b4d9a2c509db0c5111f2ac78dbd2ff72 \ No newline at end of file diff --git a/lib/diff/lcs_test.go b/lib/diff/lcs_test.go index a935e14..5dfeb6b 100644 --- a/lib/diff/lcs_test.go +++ b/lib/diff/lcs_test.go @@ -87,6 +87,19 @@ func TestLCSString(t *testing.T) { eq(string(x), string(y), "yx") } +func TestLCSRandomString(t *testing.T) { + g := got.T(t) + + x := g.ReadFile("fixtures/rand_x.txt").String() + y := g.ReadFile("fixtures/rand_y.txt").String() + + res := diff.NewWords(split(x)).LCS(g.Context(), diff.NewWords(split(y))) + g.Eq( + res.String(), + g.ReadFile("fixtures/rand_lcs.txt").String(), + ) +} + func TestText(t *testing.T) { g := setup(t) g.Len(diff.NewLines("a"), 1)