konstantinvlasenko / PowerSlim

Fitnesse Slim implementation in PowerShell. PowerSlim makes it possible to use PowerShell in the acceptance testing
powerslim.org
GNU General Public License v3.0
48 stars 21 forks source link

convert Fitnesse hash table to Powershell hash table #78

Open DellHenryHan opened 9 years ago

DellHenryHan commented 9 years ago
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"-!}|

konstantinvlasenko commented 9 years ago

Can you create a pull request with proposed fix and test?