mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
examples: sd_card: fix example test not getting the expected name
SD card example prints the line which looks like: Name: 00000 If only part of the line is received, the regular expression in the test still matches, and partial name is obtained. Later the example test expects to see the same name in the file read from the SD card. This check fails, because only partial name was received earlier. Fix by adding a CR to the regular expression so that the entire name is matched.
This commit is contained in:
@@ -16,7 +16,7 @@ def test_examples_sd_card_sdmmc(env, extra_data): # type: (ttfw_idf.Env.Env, No
|
||||
dut.expect('Filesystem mounted', timeout=60)
|
||||
|
||||
# These lines are matched separately because of ASCII color codes in the output
|
||||
name = dut.expect(re.compile(r'Name: (\w+)'), timeout=10)[0]
|
||||
name = dut.expect(re.compile(r'Name: (\w+)\r'), timeout=10)[0]
|
||||
_type = dut.expect(re.compile(r'Type: (\S+)'), timeout=10)[0]
|
||||
speed = dut.expect(re.compile(r'Speed: (\S+)'), timeout=10)[0]
|
||||
size = dut.expect(re.compile(r'Size: (\S+)'), timeout=10)[0]
|
||||
|
@@ -16,7 +16,7 @@ def test_examples_sd_card_sdspi(env, extra_data): # type: (ttfw_idf.Env.Env, No
|
||||
dut.expect('Filesystem mounted', timeout=60)
|
||||
|
||||
# These lines are matched separately because of ASCII color codes in the output
|
||||
name = dut.expect(re.compile(r'Name: (\w+)'), timeout=20)[0]
|
||||
name = dut.expect(re.compile(r'Name: (\w+)\r'), timeout=20)[0]
|
||||
_type = dut.expect(re.compile(r'Type: (\S+)'), timeout=20)[0]
|
||||
speed = dut.expect(re.compile(r'Speed: (\S+)'), timeout=20)[0]
|
||||
size = dut.expect(re.compile(r'Size: (\S+)'), timeout=20)[0]
|
||||
|
Reference in New Issue
Block a user