Skip to content

Commit a2de77d

Browse files
committed
Use new raw string literal syntax
1 parent 54815a6 commit a2de77d

File tree

1 file changed

+65
-37
lines changed

1 file changed

+65
-37
lines changed

test/Microsoft.Data.Analysis.Tests/DataFrame.IOTests.cs

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,10 +1064,12 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
10641064
{
10651065
yield return new object[] // Comma Separators in Data
10661066
{
1067-
@"Name,Age,Description
1068-
Paul,34,""Paul lives in Vermont, VA.""
1069-
Victor,29,""Victor: Funny guy""
1070-
Maria,31,",
1067+
"""
1068+
Name,Age,Description
1069+
Paul,34,"Paul lives in Vermont, VA."
1070+
Victor,29,"Victor: Funny guy"
1071+
Maria,31,
1072+
""",
10711073
',',
10721074
new Type[] { typeof(string), typeof(int), typeof(string) },
10731075
new LoadCsvVerifyingHelper(
@@ -1085,10 +1087,12 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
10851087
};
10861088
yield return new object[] // Colon Separators in Data
10871089
{
1088-
@"Name:Age:Description
1089-
Paul:34:""Paul lives in Vermont, VA.""
1090-
Victor:29:""Victor: Funny guy""
1091-
Maria:31:",
1090+
"""
1091+
Name:Age:Description
1092+
Paul:34:"Paul lives in Vermont, VA."
1093+
Victor:29:"Victor: Funny guy"
1094+
Maria:31:
1095+
""",
10921096
':',
10931097
new Type[] { typeof(string), typeof(int), typeof(string) },
10941098
new LoadCsvVerifyingHelper(
@@ -1106,10 +1110,12 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
11061110
};
11071111
yield return new object[] // Comma Separators in Header
11081112
{
1109-
@"""Na,me"",Age,Description
1110-
Paul,34,""Paul lives in Vermont, VA.""
1111-
Victor,29,""Victor: Funny guy""
1112-
Maria,31,",
1113+
"""
1114+
"Na,me",Age,Description
1115+
Paul,34,"Paul lives in Vermont, VA."
1116+
Victor,29,"Victor: Funny guy"
1117+
Maria,31,
1118+
""",
11131119
',',
11141120
new Type[] { typeof(string), typeof(int), typeof(string) },
11151121
new LoadCsvVerifyingHelper(
@@ -1127,11 +1133,13 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
11271133
};
11281134
yield return new object[] // Newlines In Data
11291135
{
1130-
@"Name,Age,Description
1131-
Paul,34,""Paul lives in Vermont
1132-
VA.""
1133-
Victor,29,""Victor: Funny guy""
1134-
Maria,31,",
1136+
"""
1137+
Name,Age,Description
1138+
Paul,34,"Paul lives in Vermont
1139+
VA."
1140+
Victor,29,"Victor: Funny guy"
1141+
Maria,31,
1142+
""",
11351143
',',
11361144
new Type[] { typeof(string), typeof(int), typeof(string) },
11371145
new LoadCsvVerifyingHelper(
@@ -1141,27 +1149,43 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
11411149
new Type[] { typeof(string), typeof(int), typeof(string) },
11421150
new object[][]
11431151
{
1144-
new object[] { "Paul", 34, @"Paul lives in Vermont
1145-
VA." },
1152+
new object[]
1153+
{
1154+
"Paul",
1155+
34,
1156+
"""
1157+
Paul lives in Vermont
1158+
VA.
1159+
"""
1160+
},
11461161
new object[] { "Victor", 29, "Victor: Funny guy" },
11471162
new object[] { "Maria", 31, "" }
11481163
}
11491164
)
11501165
};
11511166
yield return new object[] // Newlines In Header
11521167
{
1153-
@"""Na
1154-
me"":Age:Description
1155-
Paul:34:""Paul lives in Vermont, VA.""
1156-
Victor:29:""Victor: Funny guy""
1157-
Maria:31:",
1168+
"""
1169+
"Na
1170+
me":Age:Description
1171+
Paul:34:"Paul lives in Vermont, VA."
1172+
Victor:29:"Victor: Funny guy"
1173+
Maria:31:
1174+
""",
11581175
':',
11591176
new Type[] { typeof(string), typeof(int), typeof(string) },
11601177
new LoadCsvVerifyingHelper(
11611178
3,
11621179
3,
1163-
new string[] { @"Na
1164-
me", "Age", "Description" },
1180+
new string[]
1181+
{
1182+
"""
1183+
Na
1184+
me
1185+
""",
1186+
"Age",
1187+
"Description"
1188+
},
11651189
new Type[] { typeof(string), typeof(int), typeof(string) },
11661190
new object[][]
11671191
{
@@ -1173,10 +1197,12 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
11731197
};
11741198
yield return new object[] // Quotations in Data
11751199
{
1176-
@"Name,Age,Description
1177-
Paul,34,""Paul lives in """"Vermont VA"""".""
1178-
Victor,29,""Victor: Funny guy""
1179-
Maria,31,",
1200+
"""
1201+
Name,Age,Description
1202+
Paul,34,"Paul lives in ""Vermont VA""."
1203+
Victor,29,"Victor: Funny guy"
1204+
Maria,31,
1205+
""",
11801206
',',
11811207
new Type[] { typeof(string), typeof(int), typeof(string) },
11821208
new LoadCsvVerifyingHelper(
@@ -1186,28 +1212,30 @@ public static IEnumerable<object[]> CsvWithTextQualifiers_TestData()
11861212
new Type[] { typeof(string), typeof(int), typeof(string) },
11871213
new object[][]
11881214
{
1189-
new object[] { "Paul", 34, @"Paul lives in ""Vermont VA""." },
1215+
new object[] { "Paul", 34, """Paul lives in "Vermont VA".""" },
11901216
new object[] { "Victor", 29, "Victor: Funny guy" },
11911217
new object[] { "Maria", 31, "" }
11921218
}
11931219
)
11941220
};
11951221
yield return new object[] // Quotations in Header
11961222
{
1197-
@"Name,Age,""De""""script""""ion""
1198-
Paul,34,""Paul lives in Vermont, VA.""
1199-
Victor,29,""Victor: Funny guy""
1200-
Maria,31,",
1223+
"""
1224+
Name,Age,"De""script""ion"
1225+
Paul,34,"Paul lives in Vermont, VA."
1226+
Victor,29,"Victor: Funny guy"
1227+
Maria,31,
1228+
""",
12011229
',',
12021230
new Type[] { typeof(string), typeof(int), typeof(string) },
12031231
new LoadCsvVerifyingHelper(
12041232
3,
12051233
3,
1206-
new string[] { "Name", "Age", @"De""script""ion" },
1234+
new string[] { "Name", "Age", """De"script"ion""" },
12071235
new Type[] { typeof(string), typeof(int), typeof(string) },
12081236
new object[][]
12091237
{
1210-
new object[] { "Paul", 34, @"Paul lives in Vermont, VA." },
1238+
new object[] { "Paul", 34, "Paul lives in Vermont, VA." },
12111239
new object[] { "Victor", 29, "Victor: Funny guy" },
12121240
new object[] { "Maria", 31, "" }
12131241
}

0 commit comments

Comments
 (0)