Explorar el Código

improve test with undefined/null lookup hit using dot notation

tags/v2.1.1
David da Silva Phillip Johnsen hace 11 años
padre
commit
931f49b5da
Se han modificado 3 ficheros con 24 adiciones y 1 borrados
  1. +14
    -1
      test/_files/null_lookup_object.js
  2. +6
    -0
      test/_files/null_lookup_object.mustache
  3. +4
    -0
      test/_files/null_lookup_object.txt

+ 14
- 1
test/_files/null_lookup_object.js Ver fichero

@@ -14,5 +14,18 @@
"name": "Chris", "name": "Chris",
"twitter": undefined "twitter": undefined
} }
]
],
"favorites": {
"color": "blue",
"president": "Bush",
"show": "Futurama"
},
"mascot": {
"name": "Squid",
"favorites": {
"color": "orange",
"president": undefined,
"show": null
}
}
}) })

+ 6
- 0
test/_files/null_lookup_object.mustache Ver fichero

@@ -1,3 +1,9 @@
{{#fobject}} {{#fobject}}
{{name}}'s twitter: {{#twitter}}{{.}}{{/twitter}}{{^twitter}}unknown{{/twitter}}. {{name}}'s twitter: {{#twitter}}{{.}}{{/twitter}}{{^twitter}}unknown{{/twitter}}.
{{/fobject}} {{/fobject}}

{{#mascot}}
{{name}}'s favorite color: {{#favorites.color}}{{.}}{{/favorites.color}}{{^favorites.color}}no one{{/favorites.color}}.
{{name}}'s favorite president: {{#favorites.president}}{{.}}{{/favorites.president}}{{^favorites.president}}no one{{/favorites.president}}.
{{name}}'s favorite show: {{#favorites.show}}{{.}}{{/favorites.show}}{{^favorites.show}}none{{/favorites.show}}.
{{/mascot}}

+ 4
- 0
test/_files/null_lookup_object.txt Ver fichero

@@ -1,3 +1,7 @@
Flor's twitter: @florrts. Flor's twitter: @florrts.
Miquel's twitter: unknown. Miquel's twitter: unknown.
Chris's twitter: unknown. Chris's twitter: unknown.

Squid's favorite color: orange.
Squid's favorite president: no one.
Squid's favorite show: none.

Cargando…
Cancelar
Guardar