Skip to content

convert Fitnesse hash table to Powershell hash table #78

@DellHenryHan

Description

@DellHenryHan
function Set-Script($s, $fmt){
  if(!$s){ return }
  $s = $s -replace '<table class="hash_table">\r\n', '@{' -replace '</table>','}' -replace '\t*<tr class="hash_row">\r\n','' -replace '\t*</tr>\r\n','' -replace '\t*<td class="hash_key">(.*)</td>\r\n', '''$1''=' -replace '\t*<td class="hash_value">(.*)</td>\r\n','''$1'';'

Why are the keys and values in single quotes after converted to powershell hash table? It would be better when we remove those single quotes, so that we can use more types of variables in hash table other than String without conversion, such as Array and Hashtable:
|script|
|testScenario|!{field1:!-@{a=1;b=2}-!,field2:!-"item1","item2","item3"-!}|

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions