summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2021-03-23 18:14:18 -0400
committerAndrew Gallant <jamslam@gmail.com>2021-03-23 18:14:18 -0400
commit64ac2ebe0f2fe1c8967e7ec550bc32466bf40a07 (patch)
treed09e9bc7028a7158e45426061c8967278a77a002 /tests
parent46fb77c20cc46e61117d68a68bb306cc665c6da6 (diff)
tests: fix tests for buffer size change
Sadly, there were several tests that are coupled to the size of the buffer used by ripgrep. Making the tests agnostic to the size is difficult. And it's annoying to fix the tests. But we rarely change the buffer size, so ¯\_(ツ)_/¯.
Diffstat (limited to 'tests')
-rw-r--r--tests/binary.rs30
-rw-r--r--tests/data/sherlock-nul.txt1633
2 files changed, 1648 insertions, 15 deletions
diff --git a/tests/binary.rs b/tests/binary.rs
index d93712eb..93f6844c 100644
--- a/tests/binary.rs
+++ b/tests/binary.rs
@@ -5,17 +5,17 @@ use crate::util::{Dir, TestCommand};
// bug report: https://github.com/BurntSushi/ripgrep/issues/306
// Our haystack is the first 500 lines of Gutenberg's copy of "A Study in
-// Scarlet," with a NUL byte at line 237: `abcdef\x00`.
+// Scarlet," with a NUL byte at line 1898: `abcdef\x00`.
//
// The position and size of the haystack is, unfortunately, significant. In
// particular, the NUL byte is specifically inserted at some point *after* the
-// first 8192 bytes, which corresponds to the initial capacity of the buffer
+// first 65,536 bytes, which corresponds to the initial capacity of the buffer
// that ripgrep uses to read files. (grep for DEFAULT_BUFFER_CAPACITY.) The
// position of the NUL byte ensures that we can execute some search on the
// initial buffer contents without ever detecting any binary data. Moreover,
-// when using a memory map for searching, only the first 8192 bytes are
+// when using a memory map for searching, only the first 65,536 bytes are
// scanned for a NUL byte, so no binary bytes are detected at all when using
-// a memory map (unless our query matches line 237).
+// a memory map (unless our query matches line 1898).
//
// One last note: in the tests below, we use --no-mmap heavily because binary
// detection with memory maps is a bit different. Namely, NUL bytes are only
@@ -40,7 +40,7 @@ rgtest!(after_match1_implicit, |dir: Dir, mut cmd: TestCommand| {
let expected = "\
hay:1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-hay: WARNING: stopped searching binary file after match (found \"\\0\" byte around offset 9741)
+hay: WARNING: stopped searching binary file after match (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -53,7 +53,7 @@ rgtest!(after_match1_explicit, |dir: Dir, mut cmd: TestCommand| {
let expected = "\
1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-binary file matches (found \"\\0\" byte around offset 9741)
+binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -64,7 +64,7 @@ rgtest!(after_match1_stdin, |_: Dir, mut cmd: TestCommand| {
let expected = "\
1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-binary file matches (found \"\\0\" byte around offset 9741)
+binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.pipe(HAY));
});
@@ -85,7 +85,7 @@ rgtest!(after_match1_implicit_binary, |dir: Dir, mut cmd: TestCommand| {
let expected = "\
hay:1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-hay: binary file matches (found \"\\0\" byte around offset 9741)
+hay: binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -200,7 +200,7 @@ rgtest!(after_match2_implicit, |dir: Dir, mut cmd: TestCommand| {
let expected = "\
hay:1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-hay: WARNING: stopped searching binary file after match (found \"\\0\" byte around offset 9741)
+hay: WARNING: stopped searching binary file after match (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -220,7 +220,7 @@ rgtest!(after_match2_implicit_text, |dir: Dir, mut cmd: TestCommand| {
let expected = "\
hay:1:The Project Gutenberg EBook of A Study In Scarlet, by Arthur Conan Doyle
-hay:236:\"And yet you say he is not a medical student?\"
+hay:1867:\"And yet you say he is not a medical student?\"
";
eqnice!(expected, cmd.stdout());
});
@@ -240,7 +240,7 @@ rgtest!(before_match1_explicit, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--no-mmap", "-n", "Heaven", "hay"]);
let expected = "\
-binary file matches (found \"\\0\" byte around offset 9741)
+binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -253,7 +253,7 @@ rgtest!(before_match1_implicit_binary, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--no-mmap", "-n", "--binary", "Heaven", "-g", "hay"]);
let expected = "\
-hay: binary file matches (found \"\\0\" byte around offset 9741)
+hay: binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -265,7 +265,7 @@ rgtest!(before_match1_implicit_text, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--no-mmap", "-n", "--text", "Heaven", "-g", "hay"]);
let expected = "\
-hay:238:\"No. Heaven knows what the objects of his studies are. But here we
+hay:1871:\"No. Heaven knows what the objects of his studies are. But here we
";
eqnice!(expected, cmd.stdout());
});
@@ -288,7 +288,7 @@ rgtest!(before_match2_explicit, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--no-mmap", "-n", "a medical student", "hay"]);
let expected = "\
-binary file matches (found \"\\0\" byte around offset 9741)
+binary file matches (found \"\\0\" byte around offset 77041)
";
eqnice!(expected, cmd.stdout());
});
@@ -300,7 +300,7 @@ rgtest!(before_match2_implicit_text, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--no-mmap", "-n", "--text", "a medical student", "-g", "hay"]);
let expected = "\
-hay:236:\"And yet you say he is not a medical student?\"
+hay:1867:\"And yet you say he is not a medical student?\"
";
eqnice!(expected, cmd.stdout());
});
diff --git a/tests/data/sherlock-nul.txt b/tests/data/sherlock-nul.txt
index f1c9db1b..60fb2b09 100644
--- a/tests/data/sherlock-nul.txt
+++ b/tests/data/sherlock-nul.txt
@@ -233,7 +233,1640 @@ rather a bizarre shape."
"Yes, to verify how far bruises may be produced after death. I saw him
at it with my own eyes."
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
+
+
+Title: A Study In Scarlet
+
+Author: Arthur Conan Doyle
+
+Posting Date: July 12, 2008 [EBook #244]
+Release Date: April, 1995
+[Last updated: February 17, 2013]
+
+Language: English
+
+
+*** START OF THIS PROJECT GUTENBERG EBOOK A STUDY IN SCARLET ***
+
+
+
+
+Produced by Roger Squires
+
+
+
+
+
+A STUDY IN SCARLET.
+
+By A. Conan Doyle
+
+[1]
+
+
+
+ Original Transcriber's Note: This etext is prepared directly
+ from an 1887 edition, and care has been taken to duplicate the
+ original exactly, including typographical and punctuation
+ vagaries.
+
+ Additions to the text include adding the underscore character to
+ indicate italics, and textual end-notes in square braces.
+
+ Project Gutenberg Editor's Note: In reproofing and moving old PG
+ files such as this to the present PG directory system it is the
+ policy to reformat the text to conform to present PG Standards.
+ In this case however, in consideration of the note above of the
+ original transcriber describing his care to try to duplicate the
+ original 1887 edition as to typography and punctuation vagaries,
+ no changes have been made in this ascii text file. However, in
+ the Latin-1 file and this html file, present standards are
+ followed and the several French and Spanish words have been
+ given their proper accents.
+
+ Part II, The Country of the Saints, deals much with the Mormon Church.
+
+
+
+
+A STUDY IN SCARLET.
+
+
+
+
+
+PART I.
+
+(_Being a reprint from the reminiscences of_ JOHN H. WATSON, M.D., _late
+of the Army Medical Department._) [2]
+
+
+
+
+CHAPTER I. MR. SHERLOCK HOLMES.
+
+
+IN the year 1878 I took my degree of Doctor of Medicine of the
+University of London, and proceeded to Netley to go through the course
+prescribed for surgeons in the army. Having completed my studies there,
+I was duly attached to the Fifth Northumberland Fusiliers as Assistant
+Surgeon. The regiment was stationed in India at the time, and before
+I could join it, the second Afghan war had broken out. On landing at
+Bombay, I learned that my corps had advanced through the passes, and
+was already deep in the enemy's country. I followed, however, with many
+other officers who were in the same situation as myself, and succeeded
+in reaching Candahar in safety, where I found my regiment, and at once
+entered upon my new duties.
+
+The campaign brought honours and promotion to many, but for me it had
+nothing but misfortune and disaster. I was removed from my brigade and
+attached to the Berkshires, with whom I served at the fatal battle of
+Maiwand. There I was struck on the shoulder by a Jezail bullet, which
+shattered the bone and grazed the subclavian artery. I should have
+fallen into the hands of the murderous Ghazis had it not been for the
+devotion and courage shown by Murray, my orderly, who threw me across a
+pack-horse, and succeeded in bringing me safely to the British lines.
+
+Worn with pain, and weak from the prolonged hardships which I had
+undergone, I was removed, with a great train of wounded sufferers, to
+the base hospital at Peshawar. Here I rallied, and had already improved
+so far as to be able to walk about the wards, and even to bask a little
+upon the verandah, when I was struck down by enteric fever, that curse
+of our Indian possessions. For months my life was despaired of, and
+when at last I came to myself and became convalescent, I was so weak and
+emaciated that a medical board determined that not a day should be lost
+in sending me back to England. I was dispatched, accordingly, in the
+troopship "Orontes," and landed a month later on Portsmouth jetty, with
+my health irretrievably ruined, but with permission from a paternal
+government to spend the next nine months in attempting to improve it.
+
+I had neither kith nor kin in England, and was therefore as free as
+air--or as free as an income of eleven shillings and sixpence a day will
+permit a man to be. Under such circumstances, I naturally gravitated to
+London, that great cesspool into which all the loungers and idlers of
+the Empire are irresistibly drained. There I stayed for some time at
+a private hotel in the Strand, leading a comfortless, meaningless
+existence, and spending such money as I had, considerably more freely
+than I ought. So alarming did the state of my finances become, that
+I soon realized that I must either leave the metropolis and rusticate
+somewhere in the country, or that I must make a complete alteration in
+my style of living. Choosing the latter alternative, I began by making
+up my mind to leave the hotel, and to take up my quarters in some less
+pretentious and less expensive domicile.
+
+On the very day that I had come to this conclusion, I was standing at
+the Criterion Bar, when some one tapped me on the shoulder, and turning
+round I recognized young Stamford, who had been a dresser under me at
+Barts. The sight of a friendly face in the great wilderness of London is
+a pleasant thing indeed to a lonely man. In old days Stamford had never
+been a particular crony of mine, but now I hailed him with enthusiasm,
+and he, in his turn, appeared to be delighted to see me. In the
+exuberance of my joy, I asked him to lunch with me at the Holborn, and
+we started off together in a hansom.
+
+"Whatever have you been doing with yourself, Watson?" he asked in
+undisguised wonder, as we rattled through the crowded London streets.
+"You are as thin as a lath and as brown as a nut."
+
+I gave him a short sketch of my adventures, and had hardly concluded it
+by the time that we reached our destination.
+
+"Poor devil!" he said, commiseratingly, after he had listened to my
+misfortunes. "What are you up to now?"
+
+"Looking for lodgings." [3] I answered. "Trying to solve the problem
+as to whether it is possible to get comfortable rooms at a reasonable
+price."
+
+"That's a strange thing," remarked my companion; "you are the second man
+to-day that has used that expression to me."
+
+"And who was the first?" I asked.
+
+"A fellow who is working at the chemical laboratory up at the hospital.
+He was bemoaning himself this morning because he could not get someone
+to go halves with him in some nice rooms which he had found, and which
+were too much for his purse."
+
+"By Jove!" I cried, "if he really wants someone to share the rooms and
+the expense, I am the very man for him. I should prefer having a partner
+to being alone."
+
+Young Stamford looked rather strangely at me over his wine-glass. "You
+don't know Sherlock Holmes yet," he said; "perhaps you would not care
+for him as a constant companion."
+
+"Why, what is there against him?"
+
+"Oh, I didn't say there was anything against him. He is a little queer
+in his ideas--an enthusiast in some branches of science. As far as I
+know he is a decent fellow enough."
+
+"A medical student, I suppose?" said I.
+
+"No--I have no idea what he intends to go in for. I believe he is well
+up in anatomy, and he is a first-class chemist; but, as far as I know,
+he has never taken out any systematic medical classes. His studies are
+very desultory and eccentric, but he has amassed a lot of out-of-the way
+knowledge which would astonish his professors."
+
+"Did you never ask him what he was going in for?" I asked.
+
+"No; he is not a man that it is easy to draw out, though he can be
+communicative enough when the fancy seizes him."
+
+"I should like to meet him," I said. "If I am to lodge with anyone, I
+should prefer a man of studious and quiet habits. I am not strong
+enough yet to stand much noise or excitement. I had enough of both in
+Afghanistan to last me for the remainder of my natural existence. How
+could I meet this friend of yours?"
+
+"He is sure to be at the laboratory," returned my companion. "He either
+avoids the place for weeks, or else he works there from morning to
+night. If you like, we shall drive round together after luncheon."
+
+"Certainly," I answered, and the conversation drifted away into other
+channels.
+
+As we made our way to the hospital after leaving the Holborn, Stamford
+gave me a few more particulars about the gentleman whom I proposed to
+take as a fellow-lodger.
+
+"You mustn't blame me if you don't get on with him," he said; "I know
+nothing more of him than I have learned from meeting him occasionally in
+the laboratory. You proposed this arrangement, so you must not hold me
+responsible."
+
+"If we don't get on it will be easy to part company," I answered. "It
+seems to me, Stamford," I added, looking hard at my companion, "that you
+have some reason for washing your hands of the matter. Is this fellow's
+temper so formidable, or what is it? Don't be mealy-mouthed about it."
+
+"It is not easy to express the inexpressible," he answered with a laugh.
+"Holmes is a little too scientific for my tastes--it approaches to
+cold-bloodedness. I could imagine his giving a friend a little pinch of
+the latest vegetable alkaloid, not out of malevolence, you understand,
+but simply out of a spirit of inquiry in order to have an accurate idea
+of the effects. To do him justice, I think that he would take it himself
+with the same readiness. He appears to have a passion for definite and
+exact knowledge."
+
+"Very right too."
+
+"Yes, but it may be pushed to excess. When it comes to beating the
+subjects in the dissecting-rooms with a stick, it is certainly taking
+rather a bizarre shape."
+
+"Beating the subjects!"
+
+"Yes, to verify how far bruises may be produced after death. I saw him
+at it with my own eyes."
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
+
+
+Title: A Study In Scarlet
+
+Author: Arthur Conan Doyle
+
+Posting Date: July 12, 2008 [EBook #244]
+Release Date: April, 1995
+[Last updated: February 17, 2013]
+
+Language: English
+
+
+*** START OF THIS PROJECT GUTENBERG EBOOK A STUDY IN SCARLET ***
+
+
+
+
+Produced by Roger Squires
+
+
+
+
+
+A STUDY IN SCARLET.
+
+By A. Conan Doyle
+
+[1]
+
+
+
+ Original Transcriber's Note: This etext is prepared directly
+ from an 1887 edition, and care has been taken to duplicate the
+ original exactly, including typographical and punctuation
+ vagaries.
+
+ Additions to the text include adding the underscore character to
+ indicate italics, and textual end-notes in square braces.
+
+ Project Gutenberg Editor's Note: In reproofing and moving old PG
+ files such as this to the present PG directory system it is the
+ policy to reformat the text to conform to present PG Standards.
+ In this case however, in consideration of the note above of the
+ original transcriber describing his care to try to duplicate the
+ original 1887 edition as to typography and punctuation vagaries,
+ no changes have been made in this ascii text file. However, in
+ the Latin-1 file and this html file, present standards are
+ followed and the several French and Spanish words have been
+ given their proper accents.
+
+ Part II, The Country of the Saints, deals much with the Mormon Church.
+
+
+
+
+A STUDY IN SCARLET.
+
+
+
+
+
+PART I.
+
+(_Being a reprint from the reminiscences of_ JOHN H. WATSON, M.D., _late
+of the Army Medical Department._) [2]
+
+
+
+
+CHAPTER I. MR. SHERLOCK HOLMES.
+
+
+IN the year 1878 I took my degree of Doctor of Medicine of the
+University of London, and proceeded to Netley to go through the course
+prescribed for surgeons in the army. Having completed my studies there,
+I was duly attached to the Fifth Northumberland Fusiliers as Assistant
+Surgeon. The regiment was stationed in India at the time, and before
+I could join it, the second Afghan war had broken out. On landing at
+Bombay, I learned that my corps had advanced through the passes, and
+was already deep in the enemy's country. I followed, however, with many
+other officers who were in the same situation as myself, and succeeded
+in reaching Candahar in safety, where I found my regiment, and at once
+entered upon my new duties.
+
+The campaign brought honours and promotion to many, but for me it had
+nothing but misfortune and disaster. I was removed from my brigade and
+attached to the Berkshires, with whom I served at the fatal battle of
+Maiwand. There I was struck on the shoulder by a Jezail bullet, which
+shattered the bone and grazed the subclavian artery. I should have
+fallen into the hands of the murderous Ghazis had it not been for the
+devotion and courage shown by Murray, my orderly, who threw me across a
+pack-horse, and succeeded in bringing me safely to the British lines.
+
+Worn with pain, and weak from the prolonged hardships which I had
+undergone, I was removed, with a great train of wounded sufferers, to
+the base hospital at Peshawar. Here I rallied, and had already improved
+so far as to be able to walk about the wards, and even to bask a little
+upon the verandah, when I was struck down by enteric fever, that curse
+of our Indian possessions. For months my life was despaired of, and
+when at last I came to myself and became convalescent, I was so weak and
+emaciated that a medical board determined that not a day should be lost
+in sending me back to England. I was dispatched, accordingly, in the
+troopship "Orontes," and landed a month later on Portsmouth jetty, with
+my health irretrievably ruined, but with permission from a paternal
+government to spend the next nine months in attempting to improve it.
+
+I had neither kith nor kin in England, and was therefore as free as
+air--or as free as an income of eleven shillings and sixpence a day will
+permit a man to be. Under such circumstances, I naturally gravitated to
+London, that great cesspool into which all the loungers and idlers of
+the Empire are irresistibly drained. There I stayed for some time at
+a private hotel in the Strand, leading a comfortless, meaningless
+existence, and spending such money as I had, considerably more freely
+than I ought. So alarming did the state of my finances become, that
+I soon realized that I must either leave the metropolis and rusticate
+somewhere in the country, or that I must make a complete alteration in
+my style of living. Choosing the latter alternative, I began by making
+up my mind to leave the hotel, and to take up my quarters in some less
+pretentious and less expensive domicile.
+
+On the very day that I had come to this conclusion, I was standing at
+the Criterion Bar, when some one tapped me on the shoulder, and turning
+round I recognized young Stamford, who had been a dresser under me at
+Barts. The sight of a friendly face in the great wilderness of London is
+a pleasant thing indeed to a lonely man. In old days Stamford had never
+been a particular crony of mine, but now I hailed him with enthusiasm,
+and he, in his turn, appeared to be delighted to see me. In the
+exuberance of my joy, I asked him to lunch with me at the Holborn, and
+we started off together in a hansom.
+
+"Whatever have you been doing with yourself, Watson?" he asked in
+undisguised wonder, as we rattled through the crowded London streets.
+"You are as thin as a lath and as brown as a nut."
+
+I gave him a short sketch of my adventures, and had hardly concluded it
+by the time that we reached our destination.
+
+"Poor devil!" he said, commiseratingly, after he had listened to my
+misfortunes. "What are you up to now?"
+
+"Looking for lodgings." [3] I answered. "Trying to solve the problem
+as to whether it is possible to get comfortable rooms at a reasonable
+price."
+
+"That's a strange thing," remarked my companion; "you are the second man
+to-day that has used that expression to me."
+
+"And who was the first?" I asked.
+
+"A fellow who is working at the chemical laboratory up at the hospital.
+He was bemoaning himself this morning because he could not get someone
+to go halves with him in some nice rooms which he had found, and which
+were too much for his purse."
+
+"By Jove!" I cried, "if he really wants someone to share the rooms and
+the expense, I am the very man for him. I should prefer having a partner
+to being alone."
+
+Young Stamford looked rather strangely at me over his wine-glass. "You
+don't know Sherlock Holmes yet," he said; "perhaps you would not care
+for him as a constant companion."
+
+"Why, what is there against him?"
+
+"Oh, I didn't say there was anything against him. He is a little queer
+in his ideas--an enthusiast in some branches of science. As far as I
+know he is a decent fellow enough."
+
+"A medical student, I suppose?" said I.
+
+"No--I have no idea what he intends to go in for. I believe he is well
+up in anatomy, and he is a first-class chemist; but, as far as I know,
+he has never taken out any systematic medical classes. His studies are
+very desultory and eccentric, but he has amassed a lot of out-of-the way
+knowledge which would astonish his professors."
+
+"Did you never ask him what he was going in for?" I asked.
+
+"No; he is not a man that it is easy to draw out, though he can be
+communicative enough when the fancy seizes him."
+
+"I should like to meet him," I said. "If I am to lodge with anyone, I
+should prefer a man of studious and quiet habits. I am not strong
+enough yet to stand much noise or excitement. I had enough of both in
+Afghanistan to last me for the remainder of my natural existence. How
+could I meet this friend of yours?"
+
+"He is sure to be at the laboratory," returned my companion. "He either
+avoids the place for weeks, or else he works there from morning to
+night. If you like, we shall drive round together after luncheon."
+
+"Certainly," I answered, and the conversation drifted away into other
+channels.
+
+As we made our way to the hospital after leaving the Holborn, Stamford
+gave me a few more particulars about the gentleman whom I proposed to
+take as a fellow-lodger.
+
+"You mustn't blame me if you don't get on with him," he said; "I know
+nothing more of him than I have learned from meeting him occasionally in
+the laboratory. You proposed this arrangement, so you must not hold me
+responsible."
+
+"If we don't get on it will be easy to part company," I answered. "It
+seems to me, Stamford," I added, looking hard at my companion, "that you
+have some reason for washing your hands of the matter. Is this fellow's
+temper so formidable, or what is it? Don't be mealy-mouthed about it."
+
+"It is not easy to express the inexpressible," he answered with a laugh.
+"Holmes is a little too scientific for my tastes--it approaches to
+cold-bloodedness. I could imagine his giving a friend a little pinch of
+the latest vegetable alkaloid, not out of malevolence, you understand,
+but simply out of a spirit of inquiry in order to have an accurate idea
+of the effects. To do him justice, I think that he would take it himself
+with the same readiness. He appears to have a passion for definite and
+exact knowledge."
+
+"Very right too."
+
+"Yes, but it may be pushed to excess. When it comes to beating the
+subjects in the dissecting-rooms with a stick, it is certainly taking
+rather a bizarre shape."
+
+"Beating the subjects!"
+
+"Yes, to verify how far bruises may be produced after death. I saw him
+at it with my own eyes."
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
+
+
+Title: A Study In Scarlet
+
+Author: Arthur Conan Doyle
+
+Posting Date: July 12, 2008 [EBook #244]
+Release Date: April, 1995
+[Last updated: February 17, 2013]
+
+Language: English
+
+
+*** START OF THIS PROJECT GUTENBERG EBOOK A STUDY IN SCARLET ***
+
+
+
+
+Produced by Roger Squires
+
+
+
+
+
+A STUDY IN SCARLET.
+
+By A. Conan Doyle
+
+[1]
+
+
+
+ Original Transcriber's Note: This etext is prepared directly
+ from an 1887 edition, and care has been taken to duplicate the
+ original exactly, including typographical and punctuation
+ vagaries.
+
+ Additions to the text include adding the underscore character to
+ indicate italics, and textual end-notes in square braces.
+
+ Project Gutenberg Editor's Note: In reproofing and moving old PG
+ files such as this to the present PG directory system it is the
+ policy to reformat the text to conform to present PG Standards.
+ In this case however, in consideration of the note above of the
+ original transcriber describing his care to try to duplicate the
+ original 1887 edition as to typography and punctuation vagaries,
+ no changes have been made in this ascii text file. However, in
+ the Latin-1 file and this html file, present standards are
+ followed and the several French and Spanish words have been
+ given their proper accents.
+
+ Part II, The Country of the Saints, deals much with the Mormon Church.
+
+
+
+
+A STUDY IN SCARLET.
+
+
+
+
+
+PART I.
+
+(_Being a reprint from the reminiscences of_ JOHN H. WATSON, M.D., _late
+of the Army Medical Department._) [2]
+
+
+
+
+CHAPTER I. MR. SHERLOCK HOLMES.
+
+
+IN the year 1878 I took my degree of Doctor of Medicine of the
+University of London, and proceeded to Netley to go through the course
+prescribed for surgeons in the army. Having completed my studies there,
+I was duly attached to the Fifth Northumberland Fusiliers as Assistant
+Surgeon. The regiment was stationed in India at the time, and before
+I could join it, the second Afghan war had broken out. On landing at
+Bombay, I learned that my corps had advanced through the passes, and
+was already deep in the enemy's country. I followed, however, with many
+other officers who were in the same situation as myself, and succeeded
+in reaching Candahar in safety, where I found my regiment, and at once
+entered upon my new duties.
+
+The campaign brought honours and promotion to many, but for me it had
+nothing but misfortune and disaster. I was removed from my brigade and
+attached to the Berkshires, with whom I served at the fatal battle of
+Maiwand. There I was struck on the shoulder by a Jezail bullet, which
+shattered the bone and grazed the subclavian artery. I should have
+fallen into the hands of the murderous Ghazis had it not been for the
+devotion and courage shown by Murray, my orderly, who threw me across a
+pack-horse, and succeeded in bringing me safely to the British lines.
+
+Worn with pain, and weak from the prolonged hardships which I had
+undergone, I was removed, with a great train of wounded sufferers, to
+the base hospital at Peshawar. Here I rallied, and had already improved
+so far as to be able to walk about the wards, and even to bask a little
+upon the verandah, when I was struck down by enteric fever, that curse
+of our Indian possessions. For months my life was despaired of, and
+when at last I came to myself and became convalescent, I was so weak and
+emaciated that a medical board determined that not a day should be lost
+in sending me back to England. I was dispatched, accordingly, in the
+troopship "Orontes," and landed a month later on Portsmouth jetty, with
+my health irretrievably ruined, but with permission from a paternal
+government to spend the next nine months in attempting to improve it.
+
+I had neither kith nor kin in England, and was therefore as free as
+air--or as free as an income of eleven shillings and sixpence a day will
+permit a man to be. Under such circumstances, I naturally gravitated to
+London, that great cesspool into which all the loungers and idlers of
+the Empire are irresistibly drained. There I stayed for some time at
+a private hotel in the Strand, leading a comfortless, meaningless
+existence, and spending such money as I had, considerably more freely
+than I ought. So alarming did the state of my finances become, that
+I soon realized that I must either leave the metropolis and rusticate
+somewhere in the country, or that I must make a complete alteration in
+my style of living. Choosing the latter alternative, I began by making
+up my mind to leave the hotel, and to take up my quarters in some less
+pretentious and less expensive domicile.
+
+On the very day that I had come to this conclusion, I was standing at
+the Criterion Bar, when some one tapped me on the shoulder, and turning
+round I recognized young Stamford, who had been a dresser under me at
+Barts. The sight of a friendly face in the great wilderness of London is
+a pleasant thing indeed to a lonely man. In old days Stamford had never
+been a particular crony of mine, but now I hailed him with enthusiasm,
+and he, in his turn, appeared to be delighted to see me. In the
+exuberance of my joy, I asked him to lunch with me at the Holborn, and
+we started off together in a hansom.
+
+"Whatever have you been doing with yourself, Watson?" he asked in
+undisguised wonder, as we rattled through the crowded London streets.
+"You are as thin as a lath and as brown as a nut."
+
+I gave him a short sketch of my adventures, and had hardly concluded it
+by the time that we reached our destination.
+
+"Poor devil!" he said, commiseratingly, after he had listened to my
+misfortunes. "What are you up to now?"
+
+"Looking for lodgings." [3] I answered. "Trying to solve the problem
+as to whether it is possible to get comfortable rooms at a reasonable
+price."
+
+"That's a strange thing," remarked my companion; "you are the second man
+to-day that has used that expression to me."
+
+"And who was the first?" I asked.
+
+"A fellow who is working at the chemical laboratory up at the hospital.
+He was bemoaning himself this morning because he could not get someone
+to go halves with him in some nice rooms which he had found, and which
+were too much for his purse."
+
+"By Jove!" I cried, "if he really wants someone to share the rooms and
+the expense, I am the very man for him. I should prefer having a partner
+to being alone."
+
+Young Stamford looked rather strangely at me over his wine-glass. "You
+don't know Sherlock Holmes yet," he said; "perhaps you would not care
+for him as a constant companion."
+
+"Why, what is there against him?"
+
+"Oh, I didn't say there was anything against him. He is a little queer
+in his ideas--an enthusiast in some branches of science. As far as I
+know he is a decent fellow enough."
+
+"A medical student, I suppose?" said I.
+
+"No--I have no idea what he intends to go in for. I believe he is well
+up in anatomy, and he is a first-class chemist; but, as far as I know,
+he has never taken out any systematic medical classes. His studies are
+very desultory and eccentric, but he has amassed a lot of out-of-the way
+knowledge which would astonish his professors."
+
+"Did you never ask him what he was going in for?" I asked.
+
+"No; he is not a man that it is easy to draw out, though he can be
+communicative enough when the fancy seizes him."
+
+"I should like to meet him," I said. "If I am to lodge with anyone, I
+should prefer a man of studious and quiet habits. I am not strong
+enough yet to stand much noise or excitement. I had enough of both in
+Afghanistan to last me for the remainder of my natural existence. How
+could I meet this friend of yours?"
+
+"He is sure to be at the laboratory," returned my companion. "He either
+avoids the place for weeks, or else he works there from morning to
+night. If you like, we shall drive round together after luncheon."
+
+"Certainly," I answered, and the conversation drifted away into other
+channels.
+
+As we made our way to the hospital after leaving the Holborn, Stamford
+gave me a few more particulars about the gentleman whom I proposed to
+take as a fellow-lodger.
+
+"You mustn't blame me if you don't get on with him," he said; "I know
+nothing more of him than I have learned from meeting him occasionally in
+the laboratory. You proposed this arrangement, so you must not hold me
+responsible."
+
+"If we don't get on it will be easy to part company," I answered. "It
+seems to me, Stamford," I added, looking hard at my companion, "that you
+have some reason for washing your hands of the matter. Is this fellow's
+temper so formidable, or what is it? Don't be mealy-mouthed about it."
+
+"It is not easy to express the inexpressible," he answered with a laugh.
+"Holmes is a little too scientific for my tastes--it approaches to
+cold-bloodedness. I could imagine his giving a friend a little pinch of
+the latest vegetable alkaloid, not out of malevolence, you understand,
+but simply out of a spirit of inquiry in order to have an accurate idea
+of the effects. To do him justice, I think that he would take it himself
+with the same readiness. He appears to have a passion for definite and
+exact knowledge."
+
+"Very right too."
+
+"Yes, but it may be pushed to excess. When it comes to beating the
+subjects in the dissecting-rooms with a stick, it is certainly taking
+rather a bizarre shape."
+
+"Beating the subjects!"
+
+"Yes, to verify how far bruises may be produced after death. I saw him
+at it with my own eyes."
+
+This eBook is for the use of anyone anywhere at no cost and with
+almost no restrictions whatsoever. You may copy it, give it away or
+re-use it under the terms of the Project Gutenberg License included
+with this eBook or online at www.gutenberg.org
+
+
+Title: A Study In Scarlet
+
+Author: Arthur Conan Doyle
+
+Posting Date: July 12, 2008 [EBook #244]
+Release Date: April, 1995
+[Last updated: February 17, 2013]
+
+Language: English
+
+
+*** START OF THIS PROJECT GUTENBERG EBOOK A STUDY IN SCARLET ***
+
+
+
+
+Produced by Roger Squires
+
+
+
+
+
+A STUDY IN SCARLET.
+
+By A. Conan Doyle
+
+[1]
+
+
+
+ Original Transcriber's Note: This etext is prepared directly
+ from an 1887 edition, and care has been taken to duplicate the
+ original exactly, including typographical and punctuation
+ vagaries.
+
+ Additions to the text include adding the underscore character to
+ indicate italics, and textual end-notes in square braces.
+
+ Project Gutenberg Editor's Note: In reproofing and moving old PG
+ files such as this to the present PG directory system it is the
+ policy to reformat the text to conform to present PG Standards.
+ In this case however, in consideration of the note above of the
+ original transcriber describing his care to try to duplicate the
+ original 1887 edition as to typography and punctuation vagaries,
+ no changes have been made in this ascii text file. However, in
+ the Latin-1 file and this html file, present standards are
+ followed and the several French and Spanish words have been
+ given their proper accents.
+
+ Part II, The Country of the Saints, deals much with the Mormon Church.
+
+
+
+
+A STUDY IN SCARLET.
+
+
+
+
+
+PART I.
+
+(_Being a reprint f